Comparison

plugins/muc/mod_muc.lua @ 9016:946ae1181c57

MUC: Allow an admin to recreate destroyed rooms
author Kim Alvefur <zash@zash.se>
date Wed, 11 Jul 2018 03:38:01 +0200
parent 9015:dc606dc89f44
child 9018:73320e33762d
comparison
equal deleted inserted replaced
9015:dc606dc89f44 9016:946ae1181c57
396 local room_jid = jid_bare(stanza.attr.to); 396 local room_jid = jid_bare(stanza.attr.to);
397 local room = get_room_from_jid(room_jid); 397 local room = get_room_from_jid(room_jid);
398 398
399 if room and room._data.destroyed then 399 if room and room._data.destroyed then
400 if stanza.attr.type == nil and stanza.name == "presence" then 400 if stanza.attr.type == nil and stanza.name == "presence" then
401 if room._data.locked < os.time() then 401 if is_admin(stanza.attr.from) or room._data.locked < os.time() then
402 -- Allow the room to be recreated after time has passed 402 -- Allow the room to be recreated by admin or after time has passed
403 delete_room(room); 403 delete_room(room);
404 room = nil; 404 room = nil;
405 else 405 else
406 local reply = st.reply(stanza) 406 local reply = st.reply(stanza)
407 :tag("x", {xmlns = "http://jabber.org/protocol/muc#user"}) 407 :tag("x", {xmlns = "http://jabber.org/protocol/muc#user"})