aboutsummaryrefslogtreecommitdiffstats
path: root/core/stanza_router.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-02-11 18:09:41 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-02-11 18:09:41 +0500
commit2f24ab95fe28c13d85faf1dbfa16b0c3a90b46b1 (patch)
tree999813a47346e5f4a683971e4a048dff13e1a5e8 /core/stanza_router.lua
parentc11c83d1b4762c251fdf69d3cbd9ed025f0073fd (diff)
downloadprosody-2f24ab95fe28c13d85faf1dbfa16b0c3a90b46b1.tar.gz
prosody-2f24ab95fe28c13d85faf1dbfa16b0c3a90b46b1.zip
Fixed directed presence handling to work correctly for components
Diffstat (limited to 'core/stanza_router.lua')
-rw-r--r--core/stanza_router.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/stanza_router.lua b/core/stanza_router.lua
index 3c905c6d..52a18eed 100644
--- a/core/stanza_router.lua
+++ b/core/stanza_router.lua
@@ -105,6 +105,11 @@ function core_process_stanza(origin, stanza)
return; -- FIXME what should we do here? does this work with subdomains?
end
end
+ if origin.type == "c2s" and stanza.name == "presence" and to ~= nil and not(origin.roster[to_bare] and (origin.roster[to_bare].subscription == "both" or origin.roster[to_bare].subscription == "from")) then -- directed presence
+ origin.directed = origin.directed or {};
+ origin.directed[to] = true;
+ --t_insert(origin.directed, to); -- FIXME does it make more sense to add to_bare rather than to?
+ end
if not to then
core_handle_stanza(origin, stanza);
elseif hosts[to] and hosts[to].type == "local" then -- directed at a local server
@@ -122,10 +127,6 @@ function core_process_stanza(origin, stanza)
elseif origin.type ~= "c2s" and stanza.name == "iq" and not resource then -- directed at bare JID
core_handle_stanza(origin, stanza);
else
- if origin.type == "c2s" and stanza.name == "presence" and to ~= nil and not(origin.roster[to_bare] and (origin.roster[to_bare].subscription == "both" or origin.roster[to_bare].subscription == "from")) then
- origin.directed = origin.directed or {};
- t_insert(origin.directed, to); -- FIXME does it make more sense to add to_bare rather than to?
- end
core_route_stanza(origin, stanza);
end
else