aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
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
commit4616176276adc08c8ed2379bca0fada582d0cda5 (patch)
treeccf679e39173b76b2902d5f04bb74c542dff85fe /plugins
parentc14840340a365a79517ff455b3e84d25ef62c159 (diff)
downloadprosody-4616176276adc08c8ed2379bca0fada582d0cda5.tar.gz
prosody-4616176276adc08c8ed2379bca0fada582d0cda5.zip
MUC: Hide new MUC room storage format behind an off-by-default option
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 = {};