Comparison

plugins/muc/mod_muc.lua @ 6328:93fb28851d9e

mod_muc: Fix use of undefined global. Fixes #431.
author Matthew Wild <mwild1@gmail.com>
date Tue, 05 Aug 2014 09:16:29 +0100
parent 6276:9290a2906feb
child 6332:490acb4941ca
comparison
equal deleted inserted replaced
6327:5a63f489dcc6 6328:93fb28851d9e
146 restrict_room_creation = "admin"; 146 restrict_room_creation = "admin";
147 end 147 end
148 if restrict_room_creation then 148 if restrict_room_creation then
149 local host_suffix = module.host:gsub("^[^%.]+%.", ""); 149 local host_suffix = module.host:gsub("^[^%.]+%.", "");
150 module:hook("muc-room-pre-create", function(event) 150 module:hook("muc-room-pre-create", function(event)
151 local user_jid = event.stanza.attr.from; 151 local origin, stanza = event.origin, event.stanza;
152 local user_jid = stanza.attr.from;
152 if not is_admin(user_jid) and not ( 153 if not is_admin(user_jid) and not (
153 restrict_room_creation == "local" and 154 restrict_room_creation == "local" and
154 select(2, jid_split(user_jid)) == host_suffix 155 select(2, jid_split(user_jid)) == host_suffix
155 ) then 156 ) then
156 origin.send(st.error_reply(stanza, "cancel", "not-allowed")); 157 origin.send(st.error_reply(stanza, "cancel", "not-allowed"));