Software / code / prosody
Changeset
4260:403aba5e49d5
mod_muc: Remove room from memory when it is made non-persistent and is empty
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Wed, 04 May 2011 23:12:53 +0100 |
| parents | 4258:ee445e658848 |
| children | 4261:b980a4173c1a 4275:5305a665bdd4 |
| files | plugins/muc/mod_muc.lua |
| diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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