aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-02-11 23:26:18 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-02-11 23:26:18 +0500
commit5833e92990f5035f3b4b2c8f7c3c0651b28aa23f (patch)
tree83775f90c7bf4122971cc974edf7c8db219f6e80 /core
parent55223db764c36726db0bbf69ddff3703abe4bd1f (diff)
downloadprosody-5833e92990f5035f3b4b2c8f7c3c0651b28aa23f.tar.gz
prosody-5833e92990f5035f3b4b2c8f7c3c0651b28aa23f.zip
Change the to attribute of messages to the recipients' bare JID when the recipient/resource is offline.
Diffstat (limited to 'core')
-rw-r--r--core/stanza_router.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/stanza_router.lua b/core/stanza_router.lua
index f83619c6..a8de6b4a 100644
--- a/core/stanza_router.lua
+++ b/core/stanza_router.lua
@@ -210,10 +210,10 @@ function core_route_stanza(origin, stanza)
end
end
elseif stanza.name == "message" then -- select a resource to recieve message
- if message.attr.type == 'headline' then
+ stanza.attr.to = to_bare;
+ if stanza.attr.type == 'headline' then
for _, session in pairs(user.sessions) do -- find resource with greatest priority
if session.presence and session.priority >= 0 then
- stanza.attr.to = session.full_jid;
session.send(stanza);
end
end
@@ -259,6 +259,7 @@ function core_route_stanza(origin, stanza)
-- TODO send unavailable presence or unsubscribed
end
elseif stanza.name == "message" then -- FIXME if full jid, then send out to resources with highest priority
+ stanza.attr.to = to_bare; -- TODO not in RFC, but seems obvious. Should discuss on the mailing list.
if stanza.attr.type == "chat" or stanza.attr.type == "normal" or not stanza.attr.type then
offlinemanager.store(node, host, stanza);
-- FIXME don't store messages with only chat state notifications