# HG changeset patch # User Waqas Hussain # Date 1226899487 -18000 # Node ID d370fea672642a8ebef944400da9027c756468de # Parent 31fe15ce6fac5fdd04e50cad54a4e595b2625347 Fix for broadcasting presence of available resources to newly approved contact diff -r 31fe15ce6fac -r d370fea67264 core/presencemanager.lua --- a/core/presencemanager.lua Mon Nov 17 10:15:04 2008 +0500 +++ b/core/presencemanager.lua Mon Nov 17 10:24:47 2008 +0500 @@ -13,7 +13,7 @@ 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 @@ 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 @@ 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 @@ 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