Comparison

plugins/muc/muc.lib.lua @ 10688:83668e16b9a3

MUC: Switch to new storage format by default Changing the default setting of `new_muc_storage_format` from false to true. The code supports reading both formats since 0.11, but servers with MUCs stored using the new format will not be able to downgrade to 0.10 or earlier. The new format is clearer (less nesting for the most commonly-accessed data), and combined with the new map-store methods, allows for some operations to become more efficient (such as finding out which MUCs on a service a given user is affiliated with).
author Matthew Wild <mwild1@gmail.com>
date Thu, 12 Mar 2020 16:10:44 +0000
parent 10687:8c2c5b4fde32
child 10689:c6c904e4776e
comparison
equal deleted inserted replaced
10687:8c2c5b4fde32 10688:83668e16b9a3
1534 _affiliations = {}; 1534 _affiliations = {};
1535 _affiliation_data = {}; 1535 _affiliation_data = {};
1536 }, room_mt); 1536 }, room_mt);
1537 end 1537 end
1538 1538
1539 local new_format = module:get_option_boolean("new_muc_storage_format", false); 1539 local new_format = module:get_option_boolean("new_muc_storage_format", true);
1540 1540
1541 function room_mt:freeze(live) 1541 function room_mt:freeze(live)
1542 local frozen, state; 1542 local frozen, state;
1543 if new_format then 1543 if new_format then
1544 frozen = { 1544 frozen = {