\r
module "presencemanager"\r
\r
-function send_presence_of_available_resources(user, host, jid, recipient_session)\r
+function send_presence_of_available_resources(user, host, jid, recipient_session, core_route_stanza)\r
local h = hosts[host];\r
local count = 0;\r
if h and h.type == "local" then\r
if pres then\r
pres.attr.to = jid;\r
pres.attr.from = session.full_jid;\r
- recipient_session.send(pres);\r
+ core_route_stanza(recipient_session, pres);\r
pres.attr.to = nil;\r
pres.attr.from = nil;\r
count = count + 1;\r
if rostermanager.subscribed(node, host, to_bare) then\r
rostermanager.roster_push(node, host, to_bare);\r
core_route_stanza(origin, stanza);\r
- send_presence_of_available_resources(node, host, to_bare, origin);\r
+ send_presence_of_available_resources(node, host, to_bare, origin, core_route_stanza);\r
end\r
elseif stanza.attr.type == "unsubscribed" then\r
-- 1. route stanza\r
log("debug", "inbound presence "..stanza.attr.type.." from "..from_bare.." for "..to_bare);\r
if stanza.attr.type == "probe" then\r
if rostermanager.is_contact_subscribed(node, host, from_bare) then\r
- if 0 == send_presence_of_available_resources(node, host, from_bare, origin) then\r
+ if 0 == send_presence_of_available_resources(node, host, from_bare, origin, core_route_stanza) then\r
-- TODO send last recieved unavailable presence (or we MAY do nothing, which is fine too)\r
end\r
else\r