# HG changeset patch # User Kim Alvefur # Date 1460469921 -7200 # Node ID 3fcac143fe0b233e12e6387ec602a6fe38cecd46 # Parent f24b02e0d70675100da4ca6d395f0ff791b55ef2 mod_track_muc_joins: Check directed presence diff -r f24b02e0d706 -r 3fcac143fe0b mod_track_muc_joins/mod_track_muc_joins.lua --- a/mod_track_muc_joins/mod_track_muc_joins.lua Sun Apr 03 17:09:03 2016 +0200 +++ b/mod_track_muc_joins/mod_track_muc_joins.lua Tue Apr 12 16:05:21 2016 +0200 @@ -6,10 +6,16 @@ local session = sessions[stanza.attr.to]; if not session then return end; local log = session.log or module._log; + + local from_jid = stanza.attr.from; + if not session.directed or not session.directed[from_jid] then + return; -- Never sent presence there, can't be a MUC join + end + local muc_x = stanza:get_child("x", "http://jabber.org/protocol/muc#user"); if not muc_x then return end -- Not MUC related - local room = jid_bare(stanza.attr.from); + local room = jid_bare(from_jid); local joined = stanza.attr.type; if joined == nil then joined = true; @@ -36,4 +42,3 @@ end end); --- TODO Check session.directed for outgoing presence?