Software /
code /
prosody
Comparison
plugins/muc/mod_muc.lua @ 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 |
parent | 3799:6a6a39b90cc0 |
child | 4370:be14f96290a4 |
comparison
equal
deleted
inserted
replaced
4258:ee445e658848 | 4260:403aba5e49d5 |
---|---|
56 }; | 56 }; |
57 datamanager.store(node, muc_host, "config", data); | 57 datamanager.store(node, muc_host, "config", data); |
58 room._data.history = history; | 58 room._data.history = history; |
59 elseif forced then | 59 elseif forced then |
60 datamanager.store(node, muc_host, "config", nil); | 60 datamanager.store(node, muc_host, "config", nil); |
61 if not next(room._occupants) then -- Room empty | |
62 rooms[room.jid] = nil; | |
63 end | |
61 end | 64 end |
62 if forced then datamanager.store(nil, muc_host, "persistent", persistent_rooms); end | 65 if forced then datamanager.store(nil, muc_host, "persistent", persistent_rooms); end |
63 end | 66 end |
64 | 67 |
65 for jid in pairs(persistent_rooms) do | 68 for jid in pairs(persistent_rooms) do |