Mercurial > prosody-hg
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 |
| parents | 79318d548465 |
| children | cde4ef90cf3d 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 |
