MUC: Fire muc-room-destroyed event when the last participant leaves a non-persistent room
authorKim Alvefur <zash@zash.se>
Sat, 18 Jan 2014 20:14:05 +0100
changeset 5997 2d652afa57e4
parent 5992 72157e928c23
child 5998 60d86c9e02ec
MUC: Fire muc-room-destroyed event when the last participant leaves a non-persistent room
plugins/muc/mod_muc.lua
--- a/plugins/muc/mod_muc.lua	Sat Jan 18 10:37:12 2014 -0500
+++ b/plugins/muc/mod_muc.lua	Sat Jan 18 20:14:05 2014 +0100
@@ -163,6 +163,7 @@
 	if room then
 		room:handle_stanza(origin, stanza);
 		if not next(room._occupants) and not persistent_rooms[room.jid] then -- empty, non-persistent room
+			module:fire_event("muc-room-destroyed", { room = room });
 			rooms[bare] = nil; -- discard room
 		end
 	else