Comparison

plugins/muc/mod_muc.lua @ 5938:deb261fb5c04

mod_muc: Allow admins to always bypass restrict_room_creation (thanks Chris B)
author Matthew Wild <mwild1@gmail.com>
date Fri, 13 Dec 2013 12:52:03 +0000
parent 5577:8b09b0d068d4
child 5939:56d81af64fc5
child 5943:355f8b59bf1b
comparison
equal deleted inserted replaced
5937:bcad61007a4e 5938:deb261fb5c04
153 if stanza.name ~= "presence" then 153 if stanza.name ~= "presence" then
154 origin.send(st.error_reply(stanza, "cancel", "item-not-found")); 154 origin.send(st.error_reply(stanza, "cancel", "item-not-found"));
155 return true; 155 return true;
156 end 156 end
157 if not(restrict_room_creation) or 157 if not(restrict_room_creation) or
158 (restrict_room_creation == "admin" and is_admin(stanza.attr.from)) or 158 is_admin(stanza.attr.from)) or
159 (restrict_room_creation == "local" and select(2, jid_split(stanza.attr.from)) == module.host:gsub("^[^%.]+%.", "")) then 159 (restrict_room_creation == "local" and select(2, jid_split(stanza.attr.from)) == module.host:gsub("^[^%.]+%.", "")) then
160 room = create_room(bare); 160 room = create_room(bare);
161 end 161 end
162 end 162 end
163 if room then 163 if room then