Software /
code /
prosody
Comparison
plugins/muc/mod_muc.lua @ 8658:75c7e887c4b9
MUC: Only fetch stored room state if room config is loaded without error
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 16 Mar 2018 21:59:34 +0100 |
parent | 8657:a804f2e75f10 |
child | 8659:4006755c1097 |
comparison
equal
deleted
inserted
replaced
8657:a804f2e75f10 | 8658:75c7e887c4b9 |
---|---|
154 end | 154 end |
155 | 155 |
156 local function restore_room(jid) | 156 local function restore_room(jid) |
157 local node = jid_split(jid); | 157 local node = jid_split(jid); |
158 local data, err = room_configs:get(node); | 158 local data, err = room_configs:get(node); |
159 local state = room_state:get(node); | |
160 if data then | 159 if data then |
161 module:log("debug", "Restoring room %s from storage", jid); | 160 module:log("debug", "Restoring room %s from storage", jid); |
161 local state = room_state:get(node); | |
162 local room = muclib.restore_room(data, state); | 162 local room = muclib.restore_room(data, state); |
163 return track_room(room); | 163 return track_room(room); |
164 elseif err then | 164 elseif err then |
165 module:log("error", "Error restoring room %s from storage: %s", jid, err); | 165 module:log("error", "Error restoring room %s from storage: %s", jid, err); |
166 local room = muclib.new_room(jid, { locked = math.huge }); | 166 local room = muclib.new_room(jid, { locked = math.huge }); |