projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
5f7b930
)
MUC: Hide new MUC room storage format behind an off-by-default option
author
Kim Alvefur
<zash@zash.se>
Sat, 9 Jul 2016 20:33:04 +0000
(22:33 +0200)
committer
Kim Alvefur
<zash@zash.se>
Sat, 9 Jul 2016 20:33:04 +0000
(22:33 +0200)
plugins/muc/muc.lib.lua
patch
|
blob
|
history
diff --git
a/plugins/muc/muc.lib.lua
b/plugins/muc/muc.lib.lua
index 3ab9656c2f72619a18fce0ab25eb904664c2c519..ac8ebaddfb746525a9cb3747511e62bec844e8f8 100644
(file)
--- 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
}, room_mt);
end
+local new_format = module:get_option_boolean("new_muc_storage_format", false);
+
function room_mt:freeze(live)
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 = {};
end
if live then
state = {};