Diff

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
line wrap: on
line diff
--- 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.