Comparison

mod_conversejs/mod_conversejs.lua @ 3332:4fdd8b77da54

mod_conversejs: Variable rename for clarity (user may override options)
author Matthew Wild <mwild1@gmail.com>
date Thu, 27 Sep 2018 11:55:07 +0100
parent 3331:d98341bca458
child 3333:5be90562e14b
comparison
equal deleted inserted replaced
3331:d98341bca458 3332:4fdd8b77da54
50 </html> 50 </html>
51 ]]):gsub("$([%w_]+)", { js_url = js_url, css_url = css_url }); 51 ]]):gsub("$([%w_]+)", { js_url = js_url, css_url = css_url });
52 52
53 js_template = "converse.initialize(%s);"; 53 js_template = "converse.initialize(%s);";
54 54
55 local more_options = module:get_option("conversejs_options"); 55 local user_options = module:get_option("conversejs_options");
56 56
57 local function get_converse_options() 57 local function get_converse_options()
58 local allow_registration = module:get_option_boolean("allow_registration", false); 58 local allow_registration = module:get_option_boolean("allow_registration", false);
59 local converse_options = { 59 local converse_options = {
60 bosh_service_url = module:http_url("bosh","/http-bind"); 60 bosh_service_url = module:http_url("bosh","/http-bind");
65 domain_placeholder = module.host; 65 domain_placeholder = module.host;
66 allow_registration = allow_registration; 66 allow_registration = allow_registration;
67 registration_domain = allow_registration and module.host or nil; 67 registration_domain = allow_registration and module.host or nil;
68 }; 68 };
69 69
70 if type(more_options) == "table" then 70 if type(user_options) == "table" then
71 for k,v in pairs(more_options) do 71 for k,v in pairs(user_options) do
72 converse_options[k] = v; 72 converse_options[k] = v;
73 end 73 end
74 end 74 end
75 75
76 return converse_options; 76 return converse_options;