From 7d63169215f0c4c0384c717980ef54ab458c5cf3 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Sun, 22 Nov 2009 21:45:31 +0500 Subject: mod_presence: Acknowledge subscription requests by responding with an unavailable presence. --- plugins/mod_presence.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'plugins/mod_presence.lua') diff --git a/plugins/mod_presence.lua b/plugins/mod_presence.lua index f83e017b..468049cc 100644 --- a/plugins/mod_presence.lua +++ b/plugins/mod_presence.lua @@ -233,6 +233,7 @@ function handle_inbound_presence_subscriptions_and_probes(origin, stanza, from_b -- 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="unavailable"})); -- acknowledging receipt if not rostermanager.is_contact_pending_in(node, host, from_bare) then if rostermanager.set_contact_pending_in(node, host, from_bare) then sessionmanager.send_to_available_resources(node, host, stanza); -- cgit v1.2.3 From 889562f945cc57d19db944d6085fdfe5683dea5d Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Sun, 22 Nov 2009 21:47:54 +0500 Subject: mod_presence: Route incoming presence subscription stanzas (types unsubscribe, subscribed and unsubscribed) to the user before roster pushes. --- plugins/mod_presence.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'plugins/mod_presence.lua') diff --git a/plugins/mod_presence.lua b/plugins/mod_presence.lua index 468049cc..cda8dab0 100644 --- a/plugins/mod_presence.lua +++ b/plugins/mod_presence.lua @@ -242,14 +242,17 @@ function handle_inbound_presence_subscriptions_and_probes(origin, stanza, from_b end elseif stanza.attr.type == "unsubscribe" then if rostermanager.process_inbound_unsubscribe(node, host, from_bare) then + sessionmanager.send_to_interested_resources(node, host, stanza); rostermanager.roster_push(node, host, from_bare); end elseif stanza.attr.type == "subscribed" then if rostermanager.process_inbound_subscription_approval(node, host, from_bare) then + sessionmanager.send_to_interested_resources(node, host, stanza); rostermanager.roster_push(node, host, from_bare); end elseif stanza.attr.type == "unsubscribed" then if rostermanager.process_inbound_subscription_cancellation(node, host, from_bare) then + sessionmanager.send_to_interested_resources(node, host, stanza); rostermanager.roster_push(node, host, from_bare); end end -- discard any other type -- cgit v1.2.3