# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1390072445 -3600
# Node ID 2d652afa57e408a3d75c293ebf620b73a8da822c
# Parent  72157e928c230a15595b428c7f1fc75cdb9f4164
MUC: Fire muc-room-destroyed event when the last participant leaves a non-persistent room

diff -r 72157e928c23 -r 2d652afa57e4 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