changeset 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 445efff314c4
files mod_sift/mod_sift.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
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