diff options
Diffstat (limited to 'core/stanza_router.lua')
-rw-r--r-- | core/stanza_router.lua | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/core/stanza_router.lua b/core/stanza_router.lua index f27cc100..cf4257c5 100644 --- a/core/stanza_router.lua +++ b/core/stanza_router.lua @@ -17,28 +17,18 @@ local send_s2s = require "core.s2smanager".send_to_host; local user_exists = require "core.usermanager".user_exists; local rostermanager = require "core.rostermanager"; -local sessionmanager = require "core.sessionmanager"; local offlinemanager = require "core.offlinemanager"; local modules_handle_stanza = require "core.modulemanager".handle_stanza; local component_handle_stanza = require "core.componentmanager".handle_stanza; -local handle_outbound_presence_subscriptions_and_probes = function()end;--require "core.presencemanager".handle_outbound_presence_subscriptions_and_probes; -local handle_inbound_presence_subscriptions_and_probes = function()end;--require "core.presencemanager".handle_inbound_presence_subscriptions_and_probes; -local handle_normal_presence = function()end;--require "core.presencemanager".handle_normal_presence; - -local format = string.format; local tostring = tostring; -local t_concat = table.concat; local t_insert = table.insert; -local tonumber = tonumber; -local s_find = string.find; local pairs = pairs; local ipairs = ipairs; local jid_split = require "util.jid".split; local jid_prepped_split = require "util.jid".prepped_split; -local print = print; local fire_event = prosody.events.fire_event; local select_best_resources; @@ -228,7 +218,7 @@ function core_route_stanza(origin, stanza) -- if we get here, resource was not specified or was unavailable if stanza.name == "presence" 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); + -- inbound presence subscriptions and probes, already handled, so should never get here elseif not resource then -- sender is available or unavailable or error for _, session in pairs(user.sessions) do -- presence broadcast to all user resources. if session.full_jid then -- FIXME should this be just for available resources? Do we need to check subscription? @@ -268,7 +258,7 @@ function core_route_stanza(origin, stanza) if user_exists(node, host) then if stanza.name == "presence" 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); + -- inbound presence subscriptions and probes, already handled, so should never get here else -- TODO send unavailable presence or unsubscribed end @@ -310,8 +300,8 @@ function core_route_stanza(origin, stanza) stanza.attr.xmlns = xmlns; -- reset elseif origin.type == "component" or origin.type == "local" then -- Route via s2s for components and modules - log("debug", "Routing outgoing stanza for %s to %s", origin.host, host); - send_s2s(origin.host, host, stanza); + log("debug", "Routing outgoing stanza for %s to %s", from_host, host); + send_s2s(from_host, host, stanza); else log("warn", "received stanza from unhandled connection type: %s", origin.type); end |