aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_carbons.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2015-09-02 18:55:35 +0100
committerMatthew Wild <mwild1@gmail.com>2015-09-02 18:55:35 +0100
commit95e9399b77a5b7e5520cc1187c267171d4c494b7 (patch)
tree75ae2e07fd0ffea8a7063e9fbc3e5dbd0108d619 /plugins/mod_carbons.lua
parent1b379adbc661947763a198ea2a3e114359fafe82 (diff)
parent388fa0cd28e4a9911f6d6504e15126071952a453 (diff)
downloadprosody-95e9399b77a5b7e5520cc1187c267171d4c494b7.tar.gz
prosody-95e9399b77a5b7e5520cc1187c267171d4c494b7.zip
Merge 0.10->trunk
Diffstat (limited to 'plugins/mod_carbons.lua')
-rw-r--r--plugins/mod_carbons.lua10
1 files changed, 4 insertions, 6 deletions
diff --git a/plugins/mod_carbons.lua b/plugins/mod_carbons.lua
index 51242809..9b94d58d 100644
--- a/plugins/mod_carbons.lua
+++ b/plugins/mod_carbons.lua
@@ -7,7 +7,7 @@ local st = require "util.stanza";
local jid_bare = require "util.jid".bare;
local xmlns_carbons = "urn:xmpp:carbons:2";
local xmlns_forward = "urn:xmpp:forward:0";
-local full_sessions, bare_sessions = full_sessions, bare_sessions;
+local full_sessions, bare_sessions = prosody.full_sessions, prosody.bare_sessions;
local function toggle_carbons(event)
local origin, stanza = event.origin, event.stanza;
@@ -21,14 +21,12 @@ module:hook("iq-set/self/"..xmlns_carbons..":enable", toggle_carbons);
local function message_handler(event, c2s)
local origin, stanza = event.origin, event.stanza;
- local orig_type = stanza.attr.type;
+ local orig_type = stanza.attr.type or "normal";
local orig_from = stanza.attr.from;
local orig_to = stanza.attr.to;
- if not (orig_type == nil
- or orig_type == "normal"
- or orig_type == "chat") then
- return -- No carbons for messages of type error or headline
+ 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