Comparison

plugins/muc/mod_muc.lua @ 6235:d433db49e353

plugins/muc/mod_muc: Use get_option_string instead of get_option and checking
author daurnimator <quae@daurnimator.com>
date Mon, 28 Apr 2014 16:33:54 -0400
parent 6234:cc8a6ca2d7c5
child 6236:ee996e679f15
comparison
equal deleted inserted replaced
6234:cc8a6ca2d7c5 6235:d433db49e353
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");
17 if type(muc_name) ~= "string" then muc_name = "Prosody Chatrooms"; end
18 local restrict_room_creation = module:get_option("restrict_room_creation"); 16 local restrict_room_creation = module:get_option("restrict_room_creation");
19 if restrict_room_creation then 17 if restrict_room_creation then
20 if restrict_room_creation == true then 18 if restrict_room_creation == true then
21 restrict_room_creation = "admin"; 19 restrict_room_creation = "admin";
22 elseif restrict_room_creation ~= "admin" and restrict_room_creation ~= "local" then 20 elseif restrict_room_creation ~= "admin" and restrict_room_creation ~= "local" then
42 40
43 -- Configurable options 41 -- Configurable options
44 muclib.set_max_history_length(module:get_option_number("max_history_messages")); 42 muclib.set_max_history_length(module:get_option_number("max_history_messages"));
45 43
46 module:depends("disco"); 44 module:depends("disco");
47 module:add_identity("conference", "text", muc_name); 45 module:add_identity("conference", "text", module:get_option_string("name", "Prosody Chatrooms"));
48 module:add_feature("http://jabber.org/protocol/muc"); 46 module:add_feature("http://jabber.org/protocol/muc");
49 module:depends "muc_unique" 47 module:depends "muc_unique"
50 module:require "muc/lock"; 48 module:require "muc/lock";
51 49
52 local function is_admin(jid) 50 local function is_admin(jid)