# HG changeset patch # User Kim Alvefur # Date 1531736359 -7200 # Node ID c58be87e62d0eeb0df8485d4e976867f5bdf08cb # Parent ab3488ee3ca581aa6f67535b0f6c39ff6238b574 MUC: Return 'gone' error for destroyed rooms in other cases than attempted join Lock expiry -> Reset Admin wants to join -> Reset Still locked -> cancel, gone Don't return error in response to an error diff -r ab3488ee3ca5 -r c58be87e62d0 plugins/muc/mod_muc.lua --- a/plugins/muc/mod_muc.lua Sun Jul 15 22:50:05 2018 +0200 +++ b/plugins/muc/mod_muc.lua Mon Jul 16 12:19:19 2018 +0200 @@ -399,20 +399,20 @@ local room = get_room_from_jid(room_jid); if room and room._data.destroyed then - if stanza.attr.type == nil and stanza.name == "presence" then - if is_admin(stanza.attr.from) or room._data.locked < os.time() then - -- Allow the room to be recreated by admin or after time has passed - delete_room(room); - room = nil; - else + if room._data.locked < os.time() or (is_admin(stanza.attr.from) and stanza.name == "presence" and stanza.attr.type == nil) then + -- Allow the room to be recreated by admin or after time has passed + delete_room(room); + room = nil; + else + if stanza.attr.type ~= "error" then local reply = st.error_reply(stanza, "cancel", "gone", room._data.reason) if room._data.newjid then local uri = "xmpp:"..room._data.newjid.."?join"; reply:get_child("error"):child_with_name("gone"):text(uri); end event.origin.send(reply); - return true; end + return true; end end