mod_presence: Broadcast a user's presence to only the user's 'available' resources

Fri, 24 Apr 2009 00:38:40 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Fri, 24 Apr 2009 00:38:40 +0500
changeset 1057
2677f5a4e66b
parent 1056
09821f8ad319
child 1058
63b7a81d45eb

mod_presence: Broadcast a user's presence to only the user's 'available' resources

plugins/mod_presence.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_presence.lua	Fri Apr 24 00:35:50 2009 +0500
+++ b/plugins/mod_presence.lua	Fri Apr 24 00:38:40 2009 +0500
@@ -65,7 +65,7 @@
 		end
 		local node, host = jid_split(stanza.attr.from);
 		for _, res in pairs(hosts[host].sessions[node].sessions) do -- broadcast to all resources
-			if res ~= origin and res.full_jid then -- to resource. FIXME is res.full_jid the correct check? Maybe it should be res.presence
+			if res ~= origin and res.presence then -- to resource
 				stanza.attr.to = res.full_jid;
 				core_route_stanza(origin, stanza);
 			end

mercurial