Mercurial > prosody-modules
diff mod_sift/mod_sift.lua @ 142:f37de7e2ad14
mod_sift: Iterate on user sessions, not on the user itself, when sifting stanzas to bare JIDs.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sat, 06 Mar 2010 22:32:12 +0500 |
parents | b42a88eba9ba |
children | 7dbde05b48a9 |
line wrap: on
line diff
--- a/mod_sift/mod_sift.lua Sat Mar 06 22:30:51 2010 +0500 +++ b/mod_sift/mod_sift.lua Sat Mar 06 22:32:12 2010 +0500 @@ -131,7 +131,7 @@ local origin, stanza = event.origin, event.stanza; local user = bare_sessions[jid_bare(stanza.attr.to)]; local allowed = false; - for _, session in pairs(user or {}) do + for _, session in pairs(user and user.sessions or {}) do local siftdata = data[session.full_jid]; if siftdata and siftdata.message then -- we seem to have an message filter for _, childtag in ipairs(stanza.tags) do @@ -175,7 +175,7 @@ local origin, stanza = event.origin, event.stanza; local user = bare_sessions[jid_bare(stanza.attr.to)]; local allowed = false; - for _, session in pairs(user or {}) do + for _, session in pairs(user and user.sessions or {}) do local siftdata = data[session.full_jid]; if siftdata and siftdata.presence then -- we seem to have an presence filter for _, childtag in ipairs(stanza.tags) do