# HG changeset patch # User Waqas Hussain # Date 1252506516 -18000 # Node ID 649dd3439809edaa84efb138bb305d22d6339d13 # Parent b039538b9428d7f0bbc0d0d869838aa491dea5dc MUC: Discard non-persistent rooms as soon as they become empty. diff -r b039538b9428 -r 649dd3439809 plugins/muc/mod_muc.lua --- 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