aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2008-11-08 05:06:22 +0500
committerWaqas Hussain <waqas20@gmail.com>2008-11-08 05:06:22 +0500
commit12938dcfc8f9b65e0cc176def68043883b3afa9c (patch)
tree8dbe48464bd876a38b8c68262c29b1b79be0c52b /core
parentb5ae4957d4a82c3277de6af1684a60931e5443df (diff)
downloadprosody-12938dcfc8f9b65e0cc176def68043883b3afa9c.tar.gz
prosody-12938dcfc8f9b65e0cc176def68043883b3afa9c.zip
Redirecting all stanzas not from origin of type s2sin and c2s to core_handle_stanza
Diffstat (limited to 'core')
-rw-r--r--core/stanza_router.lua40
1 files changed, 21 insertions, 19 deletions
diff --git a/core/stanza_router.lua b/core/stanza_router.lua
index 83470975..0a5ff0be 100644
--- a/core/stanza_router.lua
+++ b/core/stanza_router.lua
@@ -71,26 +71,28 @@ function core_process_stanza(origin, stanza)
end]] -- FIXME
-- FIXME do stanzas not of jabber:client get handled by components?
- if not to then
- core_handle_stanza(origin, stanza);
- elseif hosts[to] and hosts[to].type == "local" then -- directed at a local server
- core_handle_stanza(origin, stanza);
- elseif stanza.attr.xmlns and stanza.attr.xmlns ~= "jabber:client" and stanza.attr.xmlns ~= "jabber:server" then
- modules_handle_stanza(origin, stanza);
- elseif hosts[to_bare] and hosts[to_bare].type == "component" then -- hack to allow components to handle node@server
- component_handle_stanza(origin, stanza);
- elseif hosts[to] and hosts[to].type == "component" then -- hack to allow components to handle node@server/resource and server/resource
- component_handle_stanza(origin, stanza);
- elseif hosts[host] and hosts[host].type == "component" then -- directed at a component
- component_handle_stanza(origin, stanza);
- elseif origin.type == "c2s" and stanza.name == "presence" and stanza.attr.type ~= nil and stanza.attr.type ~= "unavailable" then
- handle_outbound_presence_subscriptions_and_probes(origin, stanza, from_bare, to_bare);
- elseif stanza.name == "iq" and not resource then -- directed at bare JID
- core_handle_stanza(origin, stanza);
- elseif origin.type == "c2s" or origin.type == "s2sin" then
- core_route_stanza(origin, stanza);
+ if origin.type == "s2sin" or origin.type == "c2s" then
+ if not to then
+ core_handle_stanza(origin, stanza);
+ elseif hosts[to] and hosts[to].type == "local" then -- directed at a local server
+ core_handle_stanza(origin, stanza);
+ elseif stanza.attr.xmlns and stanza.attr.xmlns ~= "jabber:client" and stanza.attr.xmlns ~= "jabber:server" then
+ modules_handle_stanza(origin, stanza);
+ elseif hosts[to_bare] and hosts[to_bare].type == "component" then -- hack to allow components to handle node@server
+ component_handle_stanza(origin, stanza);
+ elseif hosts[to] and hosts[to].type == "component" then -- hack to allow components to handle node@server/resource and server/resource
+ component_handle_stanza(origin, stanza);
+ elseif hosts[host] and hosts[host].type == "component" then -- directed at a component
+ component_handle_stanza(origin, stanza);
+ elseif origin.type == "c2s" and stanza.name == "presence" and stanza.attr.type ~= nil and stanza.attr.type ~= "unavailable" then
+ handle_outbound_presence_subscriptions_and_probes(origin, stanza, from_bare, to_bare);
+ elseif stanza.name == "iq" and not resource then -- directed at bare JID
+ core_handle_stanza(origin, stanza);
+ else
+ core_route_stanza(origin, stanza);
+ end
else
- log("warn", "stanza not processed");
+ core_handle_stanza(origin, stanza);
end
end