From: Kim Alvefur Date: Sat, 9 Jul 2016 20:33:04 +0000 (+0200) Subject: MUC: Hide new MUC room storage format behind an off-by-default option X-Git-Url: https://git.enpas.org/?p=prosody.git;a=commitdiff_plain;h=274c1242b6a14f75e233d67d2fe2073cd29028f2 MUC: Hide new MUC room storage format behind an off-by-default option --- 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 = {};