Comparison

plugins/muc/mod_muc.lua @ 7266:f0a2a305b788

MUC: Use type-specific config API for the 'name' option
author Kim Alvefur <zash@zash.se>
date Fri, 11 Mar 2016 13:34:32 +0100
parent 6744:79318d548465
child 7269:cde4ef90cf3d
child 7746:3dff38ffdcd0
comparison
equal deleted inserted replaced
7265:78be11bf62bf 7266:f0a2a305b788
11 if module:get_host_type() ~= "component" then 11 if module:get_host_type() ~= "component" then
12 error("MUC should be loaded as a component, please see http://prosody.im/doc/components", 0); 12 error("MUC should be loaded as a component, please see http://prosody.im/doc/components", 0);
13 end 13 end
14 14
15 local muc_host = module:get_host(); 15 local muc_host = module:get_host();
16 local muc_name = module:get_option("name"); 16 local muc_name = module:get_option_string("name", "Prosody Chatrooms");
17 if type(muc_name) ~= "string" then muc_name = "Prosody Chatrooms"; end
18 local restrict_room_creation = module:get_option("restrict_room_creation"); 17 local restrict_room_creation = module:get_option("restrict_room_creation");
19 if restrict_room_creation then 18 if restrict_room_creation then
20 if restrict_room_creation == true then 19 if restrict_room_creation == true then
21 restrict_room_creation = "admin"; 20 restrict_room_creation = "admin";
22 elseif restrict_room_creation ~= "admin" and restrict_room_creation ~= "local" then 21 elseif restrict_room_creation ~= "admin" and restrict_room_creation ~= "local" then