Software / code / prosody
Comparison
plugins/muc/mod_muc.lua @ 7350:24e2369b67f9
MUC: Move history to room._history
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Tue, 12 Apr 2016 19:35:55 +0200 |
| parent | 7269:cde4ef90cf3d |
| child | 7359:a5a080c12c96 |
| child | 7360:7a37fade5380 |
comparison
equal
deleted
inserted
replaced
| 7348:a8ca12e7c2fb | 7350:24e2369b67f9 |
|---|---|
| 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 room_history = room._data.history; | |
| 106 room._data.history = nil; | |
| 107 local data = { | 105 local data = { |
| 108 jid = room.jid; | 106 jid = room.jid; |
| 109 _data = room._data; | 107 _data = room._data; |
| 110 _affiliations = room._affiliations; | 108 _affiliations = room._affiliations; |
| 111 }; | 109 }; |
| 112 room_configs:set(node, data); | 110 room_configs:set(node, data); |
| 113 room._data.history = room_history; | |
| 114 elseif forced then | 111 elseif forced then |
| 115 room_configs:set(node, nil); | 112 room_configs:set(node, nil); |
| 116 if not next(room._occupants) then -- Room empty | 113 if not next(room._occupants) then -- Room empty |
| 117 rooms[room.jid] = nil; | 114 rooms[room.jid] = nil; |
| 118 end | 115 end |