Mercurial > prosody-modules
comparison mod_muc_batched_probe/mod_muc_batched_probe.lua @ 4190:e06258fc6cf1
muc_batched_probe: don't return too quickly
| author | JC Brand <jc@opkode.com> |
|---|---|
| date | Mon, 12 Oct 2020 18:01:54 +0200 |
| parents | 4611999fd8d3 |
| children |
comparison
equal
deleted
inserted
replaced
| 4188:4611999fd8d3 | 4190:e06258fc6cf1 |
|---|---|
| 8 local rooms = rawget(mod_muc, "rooms"); | 8 local rooms = rawget(mod_muc, "rooms"); |
| 9 return rooms[jid]; | 9 return rooms[jid]; |
| 10 end | 10 end |
| 11 | 11 |
| 12 module:log("debug", "Module loaded"); | 12 module:log("debug", "Module loaded"); |
| 13 | |
| 14 | 13 |
| 15 local function respondToBatchedProbe(event) | 14 local function respondToBatchedProbe(event) |
| 16 local stanza = event.stanza; | 15 local stanza = event.stanza; |
| 17 if stanza.attr.type ~= "get" then | 16 if stanza.attr.type ~= "get" then |
| 18 return; | 17 return; |
| 36 if probed_occupant == nil then | 35 if probed_occupant == nil then |
| 37 local pr = room:build_unavailable_presence(probed_jid, stanza.attr.from); | 36 local pr = room:build_unavailable_presence(probed_jid, stanza.attr.from); |
| 38 if pr then | 37 if pr then |
| 39 room:route_stanza(pr); | 38 room:route_stanza(pr); |
| 40 end | 39 end |
| 41 return; | 40 else |
| 41 local x = st.stanza("x", {xmlns = "http://jabber.org/protocol/muc#user"}); | |
| 42 room:publicise_occupant_status(probed_occupant, x, nil, nil, nil, nil, false, probing_occupant); | |
| 42 end | 43 end |
| 43 local x = st.stanza("x", {xmlns = "http://jabber.org/protocol/muc#user"}); | |
| 44 room:publicise_occupant_status(probed_occupant, x, nil, nil, nil, nil, false, probing_occupant); | |
| 45 | |
| 46 end | 44 end |
| 47 origin.send(st.reply(stanza)); | 45 origin.send(st.reply(stanza)); |
| 48 return true; | 46 return true; |
| 49 end | 47 end |
| 50 | 48 |
