Changeset

4392:e5792ca1d704

mod_groups_internal: fix default value and handling of groups_muc_host - The new default fits the Snikket config - The error messages have been made clearer for operators to debug
author Jonas Schäfer <jonas@wielicki.name>
date Tue, 26 Jan 2021 15:39:59 +0100
parents 4391:679a0c9d365d
children 4393:ae1d1e352504
files mod_groups_internal/mod_groups_internal.lua
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mod_groups_internal/mod_groups_internal.lua	Tue Jan 26 15:37:52 2021 +0100
+++ b/mod_groups_internal/mod_groups_internal.lua	Tue Jan 26 15:39:59 2021 +0100
@@ -9,7 +9,7 @@
 local group_members_store = module:open_store("groups");
 local group_memberships = module:open_store("groups", "map");
 
-local muc_host_name = module:get_option("groups_muc_host", "chats."..host);
+local muc_host_name = module:get_option("groups_muc_host", "groups."..host);
 local muc_host = nil;
 
 local is_contact_subscribed = rostermanager.is_contact_subscribed;
@@ -245,11 +245,16 @@
 end
 
 local function handle_server_started()
+	if not muc_host_name then
+		module:log("info", "MUC management disabled (groups_muc_host set to nil)")
+		return
+	end
+
 	local target_module = modulemanager.get_module(muc_host_name, "muc")
 	if not target_module then
-		module:log("error", "host %s is not a MUC host -- group management will not work correctly", muc_host_name)
+		module:log("error", "host %s is not a MUC host -- group management will not work correctly; check your groups_muc_host setting!", muc_host_name)
 	else
-		module:log("debug", "found MUC host")
+		module:log("debug", "found MUC host at %s", muc_host_name)
 		muc_host = target_module;
 	end
 end