Comparison

plugins/muc/muc.lib.lua @ 6410:d782cbb46c2a

plugins/muc/muc.lib: Allow plugins to reject broadcasts in the muc-broadcast-message event.
author daurnimator <quae@daurnimator.com>
date Tue, 16 Sep 2014 13:02:21 -0400
parent 6394:fe034fa564ee
child 6419:84b332eacde9
comparison
equal deleted inserted replaced
6409:5fd6c739e9bf 6410:d782cbb46c2a
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 module:fire_event("muc-broadcast-message", {room = self, stanza = stanza}); 167 if module:fire_event("muc-broadcast-message", {room = self, stanza = stanza}) then
168 return true;
169 end
168 self:broadcast(stanza); 170 self:broadcast(stanza);
171 return true;
169 end 172 end
170 173
171 -- Broadcast a stanza to all occupants in the room. 174 -- Broadcast a stanza to all occupants in the room.
172 -- optionally checks conditional called with (nick, occupant) 175 -- optionally checks conditional called with (nick, occupant)
173 function room_mt:broadcast(stanza, cond_func) 176 function room_mt:broadcast(stanza, cond_func)