plugins/muc/muc.lib: Allow plugins to reject broadcasts in the muc-broadcast-message event.
authordaurnimator <quae@daurnimator.com>
Tue, 16 Sep 2014 13:02:21 -0400
changeset 6413 d782cbb46c2a
parent 6412 5fd6c739e9bf
child 6421 ae798314347c
plugins/muc/muc.lib: Allow plugins to reject broadcasts in the muc-broadcast-message event.
plugins/muc/muc.lib.lua
--- a/plugins/muc/muc.lib.lua	Tue Sep 16 12:27:05 2014 -0400
+++ b/plugins/muc/muc.lib.lua	Tue Sep 16 13:02:21 2014 -0400
@@ -164,8 +164,11 @@
 end
 
 function room_mt:broadcast_message(stanza)
-	module:fire_event("muc-broadcast-message", {room = self, stanza = stanza});
+	if module:fire_event("muc-broadcast-message", {room = self, stanza = stanza}) then
+		return true;
+	end
 	self:broadcast(stanza);
+	return true;
 end
 
 -- Broadcast a stanza to all occupants in the room.