diff -r dd523bfc9ea9 -r fdc68aec1d49 core/stanza_router.lua --- a/core/stanza_router.lua Sat May 16 02:07:27 2009 +0500 +++ b/core/stanza_router.lua Sat May 16 02:19:16 2009 +0500 @@ -160,7 +160,9 @@ 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 @@ 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