aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc
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
commit65cbf15f6b3904841918c2e787000cb61b89f068 (patch)
tree09ee38eae9d30c675fb4025862fa86d2562a2c24 /plugins/muc
parent843370587d38b05018895b65cfbf51205f7d51ac (diff)
downloadprosody-65cbf15f6b3904841918c2e787000cb61b89f068.tar.gz
prosody-65cbf15f6b3904841918c2e787000cb61b89f068.zip
MUC: Override methods on broken rooms to return internal-server-error instead
Diffstat (limited to 'plugins/muc')
-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