From 69a4cd5a25e4368bcc162c28138cba1d4d920c86 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Wed, 4 May 2011 23:12:53 +0100 Subject: mod_muc: Remove room from memory when it is made non-persistent and is empty --- plugins/muc/mod_muc.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'plugins/muc') diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua index 329b9270..ca2e6e20 100644 --- a/plugins/muc/mod_muc.lua +++ b/plugins/muc/mod_muc.lua @@ -58,6 +58,9 @@ local function room_save(room, forced) room._data.history = history; elseif forced then datamanager.store(node, muc_host, "config", nil); + if not next(room._occupants) then -- Room empty + rooms[room.jid] = nil; + end end if forced then datamanager.store(nil, muc_host, "persistent", persistent_rooms); end end -- cgit v1.2.3