From 5b7954b21ff39de538b6303c7308f6e0f07389d1 Mon Sep 17 00:00:00 2001
From: Kim Alvefur <zash@zash.se>
Date: Sat, 18 Jan 2014 20:14:05 +0100
Subject: MUC: Fire muc-room-destroyed event when the last participant leaves a
 non-persistent room

---
 plugins/muc/mod_muc.lua | 1 +
 1 file changed, 1 insertion(+)

(limited to 'plugins/muc')

diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua
index edebf070..6e86ab73 100644
--- a/plugins/muc/mod_muc.lua
+++ b/plugins/muc/mod_muc.lua
@@ -163,6 +163,7 @@ function stanza_handler(event)
 	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
-- 
cgit v1.2.3