aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-05-16 02:19:16 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-05-16 02:19:16 +0500
commitd21570b4f0ccf92b0eba8b0ba35bfad911d7e9b0 (patch)
tree275d044d604b6f17bd7cc4298fc3a3a3b1b2ee9b /core
parentd097fa5bf92373df1de2270c26491f983cd76137 (diff)
downloadprosody-d21570b4f0ccf92b0eba8b0ba35bfad911d7e9b0.tar.gz
prosody-d21570b4f0ccf92b0eba8b0ba35bfad911d7e9b0.zip
stanza_router: Improved message routing order
Diffstat (limited to 'core')
-rw-r--r--core/stanza_router.lua8
1 files changed, 3 insertions, 5 deletions
diff --git a/core/stanza_router.lua b/core/stanza_router.lua
index 2413b2cc..eaff7c66 100644
--- a/core/stanza_router.lua
+++ b/core/stanza_router.lua
@@ -160,7 +160,9 @@ function core_route_stanza(origin, stanza)
local user = host_session.sessions[node];
if user then
local res = user.sessions[resource];
- if not res then
+ if res then -- resource is online...
+ res.send(stanza); -- Yay \o/
+ else
-- 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
@@ -211,10 +213,6 @@ function core_route_stanza(origin, stanza)
elseif stanza.attr.type == "get" or stanza.attr.type == "set" then
origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
end
- else
- -- User + resource is online...
- stanza.attr.to = res.full_jid; -- reset at the end of function
- res.send(stanza); -- Yay \o/
end
else
-- user not online