# HG changeset patch # User Matthew Wild # Date 1304547173 -3600 # Node ID 403aba5e49d516a8887d885cd9bbf1da8428aa64 # Parent ee445e6588486a61eaa5d6a5f37cc1c6f53916ac mod_muc: Remove room from memory when it is made non-persistent and is empty diff -r ee445e658848 -r 403aba5e49d5 plugins/muc/mod_muc.lua --- a/plugins/muc/mod_muc.lua Wed Apr 20 18:19:28 2011 +0100 +++ b/plugins/muc/mod_muc.lua Wed May 04 23:12:53 2011 +0100 @@ -58,6 +58,9 @@ 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