Changeset

5577:8b09b0d068d4

mod_muc: Fire muc-room-created and muc-room-destroyed events (thanks nik)
author Matthew Wild <mwild1@gmail.com>
date Tue, 14 May 2013 09:38:54 +0100
parents 5576:7656b9f06bb5
children 5578:b8101bc0630f 5594:ad66ee47b674
files plugins/muc/mod_muc.lua plugins/muc/muc.lib.lua
diffstat 2 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/muc/mod_muc.lua	Mon May 13 15:52:01 2013 -0400
+++ b/plugins/muc/mod_muc.lua	Tue May 14 09:38:54 2013 +0100
@@ -83,6 +83,7 @@
 	room.route_stanza = room_route_stanza;
 	room.save = room_save;
 	rooms[jid] = room;
+	module:fire_event("muc-room-created", { room = room });
 	return room;
 end
 
--- a/plugins/muc/muc.lib.lua	Mon May 13 15:52:01 2013 -0400
+++ b/plugins/muc/muc.lib.lua	Tue May 14 09:38:54 2013 +0100
@@ -767,6 +767,7 @@
 		self._occupants[nick] = nil;
 	end
 	self:set_persistent(false);
+	module:fire_event("muc-room-destroyed", { room = self });
 end
 
 function room_mt:handle_to_room(origin, stanza) -- presence changes and groupchat messages, along with disco/etc