aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_carbons.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-12-10 02:55:38 +0100
committerKim Alvefur <zash@zash.se>2016-12-10 02:55:38 +0100
commit21a13c5bca4e9f3b87dff4edfb0a291da128b8a3 (patch)
tree0c45bcdafed730fb0e14edfd08a8f649bf100fa6 /plugins/mod_carbons.lua
parentdec1fd604cc7dedef23b3885013fa821492ef86b (diff)
parentbbaaaa99a4da333262792a211c46ec93ae0b270a (diff)
downloadprosody-21a13c5bca4e9f3b87dff4edfb0a291da128b8a3.tar.gz
prosody-21a13c5bca4e9f3b87dff4edfb0a291da128b8a3.zip
Merge 0.10->trunk
Diffstat (limited to 'plugins/mod_carbons.lua')
-rw-r--r--plugins/mod_carbons.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/mod_carbons.lua b/plugins/mod_carbons.lua
index 4984b908..cb7d9233 100644
--- a/plugins/mod_carbons.lua
+++ b/plugins/mod_carbons.lua
@@ -24,21 +24,23 @@ local function message_handler(event, c2s)
local origin, stanza = event.origin, event.stanza;
local orig_type = stanza.attr.type or "normal";
local orig_from = stanza.attr.from;
+ local bare_from = jid_bare(orig_from);
local orig_to = stanza.attr.to;
-
+ local bare_to = jid_bare(orig_to);
+
if not(orig_type == "chat" or (orig_type == "normal" and stanza:get_child("body"))) then
return -- Only chat type messages
end
-- Stanza sent by a local client
- local bare_jid = jid_bare(orig_from);
+ local bare_jid = bare_from; -- JID of the local user
local target_session = origin;
local top_priority = false;
- local user_sessions = bare_sessions[bare_jid];
+ local user_sessions = bare_sessions[bare_from];
-- Stanza about to be delivered to a local client
if not c2s then
- bare_jid = jid_bare(orig_to);
+ bare_jid = bare_to;
target_session = full_sessions[orig_to];
user_sessions = bare_sessions[bare_jid];
if not target_session and user_sessions then