aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-03-22 20:08:32 +0100
committerKim Alvefur <zash@zash.se>2018-03-22 20:08:32 +0100
commit15834a1d1c7dd5307b6340747a5adcef84252d87 (patch)
tree09ee38eae9d30c675fb4025862fa86d2562a2c24 /plugins
parent2ad8575dae2650faf8717835d00725970f826ff4 (diff)
downloadprosody-15834a1d1c7dd5307b6340747a5adcef84252d87.tar.gz
prosody-15834a1d1c7dd5307b6340747a5adcef84252d87.zip
MUC: Override methods on broken rooms to return internal-server-error instead
Diffstat (limited to 'plugins')
-rw-r--r--plugins/muc/mod_muc.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua
index 6ba0ffb5..d9d8fa2e 100644
--- a/plugins/muc/mod_muc.lua
+++ b/plugins/muc/mod_muc.lua
@@ -153,6 +153,12 @@ function track_room(room)
return false;
end
+local function handle_broken_room(room, origin, stanza)
+ module:log("debug", "Returning error from broken room %s", room.jid);
+ origin.send(st.error_reply(stanza, "wait", "internal-server-error"));
+ return true;
+end
+
local function restore_room(jid)
local node = jid_split(jid);
local data, err = room_configs:get(node);
@@ -167,6 +173,8 @@ local function restore_room(jid)
elseif err then
module:log("error", "Error restoring room %s from storage: %s", jid, err);
local room = muclib.new_room(jid, { locked = math.huge });
+ room.handle_normal_presence = handle_broken_room;
+ room.handle_first_presence = handle_broken_room;
return room;
end
end