changeset 2454:51cf82d36a8a

mod_candy: Add support for enabling Candy debug mode from Prosodys config
author Kim Alvefur <zash@zash.se>
date Fri, 20 Jan 2017 01:30:34 +0100
parents f36a6dcc05ef
children dc30ca5ce315
files mod_candy/mod_candy.lua mod_candy/www_files/index.html
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_candy/mod_candy.lua	Fri Jan 20 01:21:21 2017 +0100
+++ b/mod_candy/mod_candy.lua	Fri Jan 20 01:30:34 2017 +0100
@@ -8,6 +8,7 @@
 local serve = module:depends"http_files".serve;
 
 local candy_rooms = module:get_option_array("candy_rooms");
+local candy_debug = module:get_option_boolean("candy_debug", false);
 
 local function get_autojoin()
 	if candy_rooms then
@@ -47,6 +48,7 @@
 						autojoin = get_autojoin();
 						version = prosody.version;
 						host = module:get_host();
+						debug = candy_debug;
 						anonymous = module:get_option_string("authentication") == "anonymous";
 					}));
 		end;
--- a/mod_candy/www_files/index.html	Fri Jan 20 01:21:21 2017 +0100
+++ b/mod_candy/www_files/index.html	Fri Jan 20 01:30:34 2017 +0100
@@ -16,7 +16,7 @@
 			Candy.init(Prosody.connect_path, {
 				core: {
 					// only set this to true if developing / debugging errors
-					debug: false,
+					debug: Prosody.debug,
 					// autojoin is a *required* parameter if you don't have a plugin (e.g. roomPanel) for it
 					//   true
 					//     -> fetch info from server (NOTE: does only work with openfire server)