aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-07-09 22:33:04 +0200
committerKim Alvefur <zash@zash.se>2016-07-09 22:33:04 +0200
commit609cd70a7c4ab80fad47a77a32c7d70fda8779ae (patch)
treeccf679e39173b76b2902d5f04bb74c542dff85fe /plugins/muc
parent7b3f79b2ec8c94a585354d442bc9680cea62c5a3 (diff)
downloadprosody-609cd70a7c4ab80fad47a77a32c7d70fda8779ae.tar.gz
prosody-609cd70a7c4ab80fad47a77a32c7d70fda8779ae.zip
MUC: Hide new MUC room storage format behind an off-by-default option
Diffstat (limited to 'plugins/muc')
-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 = {};