Changeset

5997:2d652afa57e4

MUC: Fire muc-room-destroyed event when the last participant leaves a non-persistent room
author Kim Alvefur <zash@zash.se>
date Sat, 18 Jan 2014 20:14:05 +0100
parents 5992:72157e928c23
children 5998:60d86c9e02ec
files plugins/muc/mod_muc.lua
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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