aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-08-26 17:35:41 +0200
committerKim Alvefur <zash@zash.se>2015-08-26 17:35:41 +0200
commit44a083cf43f17a5e49a274786c7550fdd1efce77 (patch)
tree4a33383eaa4e6b13e46ade0f9fd4a78f2473f007 /plugins
parent4f034c3b7a9640e6e2174cbfde57a6ad435f2daa (diff)
downloadprosody-44a083cf43f17a5e49a274786c7550fdd1efce77.tar.gz
prosody-44a083cf43f17a5e49a274786c7550fdd1efce77.zip
mod_carbons: Carbon chat messages or normal messages that have a body
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_carbons.lua8
1 files changed, 3 insertions, 5 deletions
diff --git a/plugins/mod_carbons.lua b/plugins/mod_carbons.lua
index 51242809..dc5c05e0 100644
--- a/plugins/mod_carbons.lua
+++ b/plugins/mod_carbons.lua
@@ -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