aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/muc/muc.lib.lua23
1 files changed, 17 insertions, 6 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 3ab9656c..ac8ebadd 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -1304,13 +1304,24 @@ function _M.new_room(jid, config)
}, room_mt);
end
+local new_format = module:get_option_boolean("new_muc_storage_format", false);
+
function room_mt:freeze(live)
- local frozen, state = {
- _jid = self.jid;
- _data = self._data;
- };
- for user, affiliation in pairs(self._affiliations) do
- frozen[user] = affiliation;
+ local frozen, state;
+ if new_format then
+ frozen = {
+ _jid = self.jid;
+ _data = self._data;
+ };
+ for user, affiliation in pairs(self._affiliations) do
+ frozen[user] = affiliation;
+ end
+ else
+ frozen = {
+ jid = self.jid;
+ _data = self._data;
+ _affiliations = self._affiliations;
+ };
end
if live then
state = {};