# HG changeset patch # User JC Brand # Date 1602501676 -7200 # Node ID 4611999fd8d339907173cea06beaee4c1feb0b3a # Parent e2db070173327afeeb39fb56945530b220e33a53 mod_muc_batched_probe: don't rely on mt_room:respond_to_probe method That method assumes it's responding to a `` stanza, which breaks for the bached probe use-case. diff -r e2db07017332 -r 4611999fd8d3 mod_muc_batched_probe/mod_muc_batched_probe.lua --- a/mod_muc_batched_probe/mod_muc_batched_probe.lua Sat Oct 10 16:54:06 2020 +0200 +++ b/mod_muc_batched_probe/mod_muc_batched_probe.lua Mon Oct 12 13:21:16 2020 +0200 @@ -22,12 +22,29 @@ return; end; + local origin = event.origin; local room = get_room_from_jid(stanza.attr.to); + local probing_occupant = room:get_occupant_by_real_jid(stanza.attr.from); + if probing_occupant == nil then + origin.send(st.error_reply(stanza, "cancel", "not-acceptable", "You are not currently connected to this chat", room.jid)); + return true; + end + for item in query:children() do local probed_jid = item.attr.jid; - room:respond_to_probe(stanza.attr.from, probed_jid); + local probed_occupant = room:get_occupant_by_nick(probed_jid); + if probed_occupant == nil then + local pr = room:build_unavailable_presence(probed_jid, stanza.attr.from); + if pr then + room:route_stanza(pr); + end + return; + end + local x = st.stanza("x", {xmlns = "http://jabber.org/protocol/muc#user"}); + room:publicise_occupant_status(probed_occupant, x, nil, nil, nil, nil, false, probing_occupant); + end - event.origin.send(st.reply(stanza)); + origin.send(st.reply(stanza)); return true; end