From e421d0eb42b55b011bb10eaad2a5c877e8b7ae6a Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Mon, 17 Nov 2008 10:24:47 +0500 Subject: Fix for broadcasting presence of available resources to newly approved contact --- core/presencemanager.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/presencemanager.lua b/core/presencemanager.lua index 03a3710d..4a555712 100644 --- a/core/presencemanager.lua +++ b/core/presencemanager.lua @@ -13,7 +13,7 @@ local sessionmanager = require "core.sessionmanager"; module "presencemanager" -function send_presence_of_available_resources(user, host, jid, recipient_session) +function send_presence_of_available_resources(user, host, jid, recipient_session, core_route_stanza) local h = hosts[host]; local count = 0; if h and h.type == "local" then @@ -24,7 +24,7 @@ function send_presence_of_available_resources(user, host, jid, recipient_session if pres then pres.attr.to = jid; pres.attr.from = session.full_jid; - recipient_session.send(pres); + core_route_stanza(recipient_session, pres); pres.attr.to = nil; pres.attr.from = nil; count = count + 1; @@ -61,7 +61,7 @@ function handle_outbound_presence_subscriptions_and_probes(origin, stanza, from_ if rostermanager.subscribed(node, host, to_bare) then rostermanager.roster_push(node, host, to_bare); core_route_stanza(origin, stanza); - send_presence_of_available_resources(node, host, to_bare, origin); + send_presence_of_available_resources(node, host, to_bare, origin, core_route_stanza); end elseif stanza.attr.type == "unsubscribed" then -- 1. route stanza @@ -81,7 +81,7 @@ function handle_inbound_presence_subscriptions_and_probes(origin, stanza, from_b log("debug", "inbound presence "..stanza.attr.type.." from "..from_bare.." for "..to_bare); if stanza.attr.type == "probe" then if rostermanager.is_contact_subscribed(node, host, from_bare) then - if 0 == send_presence_of_available_resources(node, host, from_bare, origin) then + 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) end else -- cgit v1.2.3