Changeset

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
parents 6409:5fd6c739e9bf
children 6418:ae798314347c
files plugins/muc/muc.lib.lua
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
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.