aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/mod_muc.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-09-09 19:28:36 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-09-09 19:28:36 +0500
commitcc8dac48bc73fdf8dc6556a02c811fae8050e931 (patch)
tree09bbaced1991bcbf0ffbb22e240ad50cd150bf61 /plugins/muc/mod_muc.lua
parentda97f5e46214ca8b4153387d183d27d62320bf83 (diff)
downloadprosody-cc8dac48bc73fdf8dc6556a02c811fae8050e931.tar.gz
prosody-cc8dac48bc73fdf8dc6556a02c811fae8050e931.zip
MUC: Discard non-persistent rooms as soon as they become empty.
Diffstat (limited to 'plugins/muc/mod_muc.lua')
-rw-r--r--plugins/muc/mod_muc.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua
index 41c8a749..28002459 100644
--- a/plugins/muc/mod_muc.lua
+++ b/plugins/muc/mod_muc.lua
@@ -114,6 +114,9 @@ component = register_component(muc_host, function(origin, stanza)
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