mod_presence: Use the local host object as the origin for auto-generated subscription approvals and cancellations.

Thu, 26 Nov 2009 15:19:59 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Thu, 26 Nov 2009 15:19:59 +0500
changeset 2259
22417227d2ce
parent 2229
3b38ec879076
child 2260
67b64995ae1e

mod_presence: Use the local host object as the origin for auto-generated subscription approvals and cancellations.

plugins/mod_presence.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_presence.lua	Thu Nov 26 13:02:10 2009 +0500
+++ b/plugins/mod_presence.lua	Thu Nov 26 15:19:59 2009 +0500
@@ -220,11 +220,11 @@
 				-- TODO send last recieved unavailable presence (or we MAY do nothing, which is fine too)
 			end
 		else
-			core_route_stanza(origin, st.presence({from=to_bare, to=from_bare, type="unsubscribed"}));
+			core_route_stanza(hosts[host], st.presence({from=to_bare, to=from_bare, type="unsubscribed"}));
 		end
 	elseif stanza.attr.type == "subscribe" then
 		if rostermanager.is_contact_subscribed(node, host, from_bare) then
-			core_route_stanza(origin, st.presence({from=to_bare, to=from_bare, type="subscribed"})); -- already subscribed
+			core_route_stanza(hosts[host], st.presence({from=to_bare, to=from_bare, type="subscribed"})); -- already subscribed
 			-- Sending presence is not clearly stated in the RFC, but it seems appropriate
 			if 0 == send_presence_of_available_resources(node, host, from_bare, origin, core_route_stanza) then
 				-- TODO send last recieved unavailable presence (or we MAY do nothing, which is fine too)

mercurial