# HG changeset patch # User Waqas Hussain # Date 1240329131 -18000 # Node ID 8d750336e5171ae1771f48bf52e7aee4f29293c3 # Parent 686fbeb411e35975f94585cea0cedc98f0c9d849 mod_presence: Fix incorrect internal routing for probes and subscriptions diff -r 686fbeb411e3 -r 8d750336e517 plugins/mod_presence.lua --- a/plugins/mod_presence.lua Tue Apr 21 03:39:32 2009 +0100 +++ b/plugins/mod_presence.lua Tue Apr 21 20:52:11 2009 +0500 @@ -41,6 +41,7 @@ end function handle_normal_presence(origin, stanza, core_route_stanza) + error("hello world") if origin.roster then for jid in pairs(origin.roster) do -- broadcast to all interested contacts local subscription = origin.roster[jid].subscription; @@ -240,7 +241,7 @@ origin.directed = origin.directed or {}; origin.directed[to] = true; end - if to == nil and stanza.attr.type ~= nil and stanza.attr.type ~= "unavailable" and stanza.attr.type ~= "error" then + if stanza.attr.type ~= nil and stanza.attr.type ~= "unavailable" and stanza.attr.type ~= "error" then handle_outbound_presence_subscriptions_and_probes(origin, stanza, from_bare, to_bare, core_route_stanza); elseif not to then handle_normal_presence(origin, stanza, core_route_stanza); @@ -248,7 +249,7 @@ core_route_stanza(origin, stanza); end elseif (origin.type == "s2sin" or origin.type == "component") and hosts[host] then - if to == nil and stanza.attr.type ~= nil and stanza.attr.type ~= "unavailable" and stanza.attr.type ~= "error" then + if stanza.attr.type ~= nil and stanza.attr.type ~= "unavailable" and stanza.attr.type ~= "error" then handle_inbound_presence_subscriptions_and_probes(origin, stanza, from_bare, to_bare, core_route_stanza); else core_route_stanza(origin, stanza);