aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-03-12 21:47:39 +0100
committerKim Alvefur <zash@zash.se>2018-03-12 21:47:39 +0100
commit8cb68bfe7edf8f4aadd47a4747a819b44b1523d6 (patch)
treecfb380da87aa848f7d1f94ad147490790aba97f7
parentd99a87a40c88cf1d5df4efee2a6deb8692562b55 (diff)
downloadprosody-8cb68bfe7edf8f4aadd47a4747a819b44b1523d6.tar.gz
prosody-8cb68bfe7edf8f4aadd47a4747a819b44b1523d6.zip
MUC: Produce an untracked, locked room on failure to read room from storage (#1091)
-rw-r--r--plugins/muc/mod_muc.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua
index 83ed4900..bd739315 100644
--- a/plugins/muc/mod_muc.lua
+++ b/plugins/muc/mod_muc.lua
@@ -148,13 +148,17 @@ end
local function restore_room(jid)
local node = jid_split(jid);
- local data = room_configs:get(node);
+ local data, err = room_configs:get(node);
local state = room_state:get(node);
if data then
module:log("debug", "Restoring room %s from storage", jid);
local room = muclib.restore_room(data, state);
track_room(room);
return room;
+ elseif err then
+ module:log("error", "Error restoring room %s from storage: %s", jid, err);
+ local room = muclib.new_room(jid, { locked = math.huge });
+ return room;
end
end