Comparison

plugins/muc/mod_muc.lua @ 7360:7a37fade5380

MUC: Move 'preserialization' step to muc.lib
author Kim Alvefur <zash@zash.se>
date Sun, 17 Apr 2016 22:09:44 +0200
parent 7350:24e2369b67f9
child 7361:3409773ca19a
comparison
equal deleted inserted replaced
7357:d69521003e91 7360:7a37fade5380
100 local function room_save(room, forced) 100 local function room_save(room, forced)
101 local node = jid_split(room.jid); 101 local node = jid_split(room.jid);
102 local is_persistent = persistent.get(room); 102 local is_persistent = persistent.get(room);
103 persistent_rooms:set(nil, room.jid, is_persistent); 103 persistent_rooms:set(nil, room.jid, is_persistent);
104 if is_persistent then 104 if is_persistent then
105 local data = { 105 local data = room:freeze();
106 jid = room.jid;
107 _data = room._data;
108 _affiliations = room._affiliations;
109 };
110 room_configs:set(node, data); 106 room_configs:set(node, data);
111 elseif forced then 107 elseif forced then
112 room_configs:set(node, nil); 108 room_configs:set(node, nil);
113 if not next(room._occupants) then -- Room empty 109 if not next(room._occupants) then -- Room empty
114 rooms[room.jid] = nil; 110 rooms[room.jid] = nil;