Comparison

plugins/muc/muc.lib.lua @ 8480:3d3706147174

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Fri, 22 Dec 2017 01:02:05 +0100
parent 8467:7269313c1324
parent 8477:597c23e1c38e
child 8481:d546815e555e
comparison
equal deleted inserted replaced
8473:f024cb5acc25 8480:3d3706147174
162 end 162 end
163 return x 163 return x
164 end 164 end
165 165
166 function room_mt:broadcast_message(stanza) 166 function room_mt:broadcast_message(stanza)
167 local to = stanza.attr.to;
168 local room_jid = self.jid;
169
170 stanza:maptags(function (child)
171 if child.name == "delay" and child.attr["xmlns"] == "urn:xmpp:delay" then
172 if child.attr["from"] == room_jid then
173 return nil;
174 end
175 end
176 if child.name == "x" and child.attr["xmlns"] == "jabber:x:delay" then
177 if child.attr["from"] == room_jid then
178 return nil;
179 end
180 end
181 return child;
182 end)
183
167 if module:fire_event("muc-broadcast-message", {room = self, stanza = stanza}) then 184 if module:fire_event("muc-broadcast-message", {room = self, stanza = stanza}) then
168 return true; 185 return true;
169 end 186 end
170 self:broadcast(stanza); 187 self:broadcast(stanza);
171 return true; 188 return true;