diff mod_mam_muc/mod_mam_muc.lua @ 1275:50c427295767

mod_mam_muc: Make the logging option in the room config reflect logging and inherit the default
author Kim Alvefur <zash@zash.se>
date Sat, 18 Jan 2014 21:04:33 +0100
parents 9fa89dc7a86f
children 01dfaf2f2782
line wrap: on
line diff
--- a/mod_mam_muc/mod_mam_muc.lua	Wed Jan 15 14:45:37 2014 +0100
+++ b/mod_mam_muc/mod_mam_muc.lua	Sat Jan 18 21:04:33 2014 +0100
@@ -33,12 +33,16 @@
 
 module:hook("muc-config-form", function(event)
 	local room, form = event.room, event.form;
+	local logging_enabled = room._data.logging;
+	if logging_enabled == nil then
+		logging_enabled = log_by_default;
+	end
 	table.insert(form,
 	{
 		name = muc_form_config_option,
 		type = "boolean",
 		label = "Enable Logging?",
-		value = room._data.logging or false,
+		value = logging_enabled,
 	}
 	);
 end);