aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/mod_muc.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-07-16 12:19:19 +0200
committerKim Alvefur <zash@zash.se>2018-07-16 12:19:19 +0200
commit195e112399876278e86e053f83e1248ceb347cf7 (patch)
treefc425bb699b7ce6f83f3702b8120cc85cac58c63 /plugins/muc/mod_muc.lua
parent9917c35bb6283da5ccb2b42cbc3f500af5884573 (diff)
downloadprosody-195e112399876278e86e053f83e1248ceb347cf7.tar.gz
prosody-195e112399876278e86e053f83e1248ceb347cf7.zip
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
Diffstat (limited to 'plugins/muc/mod_muc.lua')
-rw-r--r--plugins/muc/mod_muc.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua
index 49bb12d1..c4b69f41 100644
--- a/plugins/muc/mod_muc.lua
+++ b/plugins/muc/mod_muc.lua
@@ -399,20 +399,20 @@ for event_name, method in pairs {
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