# HG changeset patch # User Kim Alvefur # Date 1468096384 -7200 # Node ID cdabf81999031290db313081b21259eae9480397 # Parent f9e470026042b3505156477f3752747e76177ed7 MUC: Hide new MUC room storage format behind an off-by-default option diff -r f9e470026042 -r cdabf8199903 plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Fri Jul 08 22:01:10 2016 +0200 +++ b/plugins/muc/muc.lib.lua Sat Jul 09 22:33:04 2016 +0200 @@ -1304,13 +1304,24 @@ }, 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 = {};