Comparison

plugins/mod_carbons.lua @ 7670:2be85cb3bc66

mod_carbons: Make the conditions for ignoring MUC PMs more specific (fixes #744)
author Kim Alvefur <zash@zash.se>
date Fri, 23 Sep 2016 14:03:37 +0200
parent 6841:be87ab2d611c
child 7671:07fb4a8c4c89
comparison
equal deleted inserted replaced
7665:2e553f80aedd 7670:2be85cb3bc66
1 -- XEP-0280: Message Carbons implementation for Prosody 1 -- XEP-0280: Message Carbons implementation for Prosody
2 -- Copyright (C) 2011 Kim Alvefur 2 -- Copyright (C) 2011-2016 Kim Alvefur
3 -- 3 --
4 -- This file is MIT/X11 licensed. 4 -- This file is MIT/X11 licensed.
5 5
6 local st = require "util.stanza"; 6 local st = require "util.stanza";
7 local jid_bare = require "util.jid".bare; 7 local jid_bare = require "util.jid".bare;
65 module:log("debug", "Message tagged private, ignoring"); 65 module:log("debug", "Message tagged private, ignoring");
66 return 66 return
67 elseif stanza:get_child("no-copy", "urn:xmpp:hints") then 67 elseif stanza:get_child("no-copy", "urn:xmpp:hints") then
68 module:log("debug", "Message has no-copy hint, ignoring"); 68 module:log("debug", "Message has no-copy hint, ignoring");
69 return 69 return
70 elseif stanza:get_child("x", "http://jabber.org/protocol/muc#user") then 70 elseif not c2s and orig_from ~= orig_from and stanza:get_child("x", "http://jabber.org/protocol/muc#user") then
71 module:log("debug", "MUC PM, ignoring"); 71 module:log("debug", "MUC PM, ignoring");
72 return 72 return
73 end 73 end
74 74
75 -- Create the carbon copy and wrap it as per the Stanza Forwarding XEP 75 -- Create the carbon copy and wrap it as per the Stanza Forwarding XEP