Software /
code /
prosody
Diff
plugins/muc/muc.lib.lua @ 7488:cdabf8199903
MUC: Hide new MUC room storage format behind an off-by-default option
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 09 Jul 2016 22:33:04 +0200 |
parent | 7444:45d28235ebe0 |
child | 7631:f50c039d6bb1 |
line wrap: on
line diff
--- 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 = {};