Wed, 09 Sep 2009 19:28:36 +0500
MUC: Discard non-persistent rooms as soon as they become empty.
plugins/muc/mod_muc.lua | file | annotate | diff | comparison | revisions |
--- a/plugins/muc/mod_muc.lua Wed Sep 09 19:17:29 2009 +0500 +++ b/plugins/muc/mod_muc.lua Wed Sep 09 19:28:36 2009 +0500 @@ -114,6 +114,9 @@ rooms[bare] = room; end room:handle_stanza(origin, stanza); + if not next(room._occupants) and not persistent_rooms[room.jid] then -- empty, non-persistent room + rooms[bare] = nil; -- discard room + end else --[[not for us?]] end return; end