Mercurial > prosody-modules
comparison mod_carbons/mod_carbons.lua @ 2307:ad7f87bd30c8
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:01:44 +0200 |
parents | db8b256f51ff |
children | 1d05491b3e84 |
comparison
equal
deleted
inserted
replaced
2306:ad40c094e7d7 | 2307:ad7f87bd30c8 |
---|---|
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; |
72 module:log("debug", "Message tagged private, ignoring"); | 72 module:log("debug", "Message tagged private, ignoring"); |
73 return | 73 return |
74 elseif stanza:get_child("no-copy", "urn:xmpp:hints") then | 74 elseif stanza:get_child("no-copy", "urn:xmpp:hints") then |
75 module:log("debug", "Message has no-copy hint, ignoring"); | 75 module:log("debug", "Message has no-copy hint, ignoring"); |
76 return | 76 return |
77 elseif stanza:get_child("x", "http://jabber.org/protocol/muc#user") then | 77 elseif not c2s and orig_from ~= orig_from and stanza:get_child("x", "http://jabber.org/protocol/muc#user") then |
78 module:log("debug", "MUC PM, ignoring"); | 78 module:log("debug", "MUC PM, ignoring"); |
79 return | 79 return |
80 end | 80 end |
81 | 81 |
82 -- Create the carbon copy and wrap it as per the Stanza Forwarding XEP | 82 -- Create the carbon copy and wrap it as per the Stanza Forwarding XEP |