From 97e3f3710148a52d9f8ae9815b6cd94ac3a66fbe Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 26 Aug 2015 17:35:41 +0200 Subject: mod_carbons: Carbon chat messages or normal messages that have a body --- plugins/mod_carbons.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'plugins/mod_carbons.lua') 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 -- cgit v1.2.3 From 9e3ba79ab8176d415396150e96f73f2d48691b09 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 27 Aug 2015 12:17:12 +0200 Subject: mod_carbons: Get full_ and bare_sessions from the prosody global [luacheck] --- plugins/mod_carbons.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/mod_carbons.lua') diff --git a/plugins/mod_carbons.lua b/plugins/mod_carbons.lua index dc5c05e0..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; -- cgit v1.2.3