aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorJonas Wielicki <jonas@wielicki.name>2017-12-09 17:57:14 +0100
committerJonas Wielicki <jonas@wielicki.name>2017-12-09 17:57:14 +0100
commit1e1a96fa4c6c3b273a0710ed6263b975eebb624e (patch)
tree966fe6eb346bb635c7cd7120939e286db24e9d33 /plugins
parent2e7e1a301c23d055090c7926e06b58a0049da563 (diff)
downloadprosody-1e1a96fa4c6c3b273a0710ed6263b975eebb624e.tar.gz
prosody-1e1a96fa4c6c3b273a0710ed6263b975eebb624e.zip
MUC: Ensure that <delay/> elements which match our from are stripped (fixes #1055)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/muc/muc.lib.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 0dfdd1aa..0040b99c 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -122,6 +122,22 @@ function room_mt:broadcast_presence(stanza, sid, code, nick)
end
function room_mt:broadcast_message(stanza, historic)
local to = stanza.attr.to;
+ local muc_jid = self.jid;
+
+ stanza:maptags(function (child)
+ if child.name == "delay" and child.attr["xmlns"] == "urn:xmpp:delay" then
+ if child.attr["from"] == muc_jid then
+ return nil;
+ end
+ end
+ if child.name == "x" and child.attr["xmlns"] == "jabber:x:delay" then
+ if child.attr["from"] == muc_jid then
+ return nil;
+ end
+ end
+ return child;
+ end)
+
for occupant, o_data in pairs(self._occupants) do
for jid in pairs(o_data.sessions) do
stanza.attr.to = jid;