# HG changeset patch # User Kim Alvefur # Date 1521745712 -3600 # Node ID 7fc0784491efa2b814d16cc2b5401923639bcd0b # Parent 3b54f8472b51954fd0425928b0c004274dd36605 MUC: Override methods on broken rooms to return internal-server-error instead diff -r 3b54f8472b51 -r 7fc0784491ef plugins/muc/mod_muc.lua --- a/plugins/muc/mod_muc.lua Wed Mar 07 17:53:52 2018 +0100 +++ b/plugins/muc/mod_muc.lua Thu Mar 22 20:08:32 2018 +0100 @@ -153,6 +153,12 @@ 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 @@ 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