Changeset

4088:439ae12bb136

mod_easy_invite: Remove hard dependency on mod_invites_page and allow configuration of different landing page module
author Matthew Wild <mwild1@gmail.com>
date Mon, 07 Sep 2020 13:48:22 +0100
parents 4087:88a469b285f5
children 4089:ef752c5115f7
files mod_easy_invite/mod_easy_invite.lua
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_easy_invite/mod_easy_invite.lua	Mon Sep 07 13:33:42 2020 +0100
+++ b/mod_easy_invite/mod_easy_invite.lua	Mon Sep 07 13:48:22 2020 +0100
@@ -5,6 +5,7 @@
 local jid_split = require "util.jid".split;
 local split_jid = require "util.jid".split;
 local rostermanager = require "core.rostermanager";
+local modulemanager = require "core.modulemanager";
 local st = require "util.stanza";
 
 local invite_only = module:get_option_boolean("registration_invite_only", true);
@@ -247,7 +248,10 @@
 
 	-- Load mod_invites
 	invites = module:context(host):depends("invites");
-	module:context(host):depends("invites_page");
+	local invites_page_module = module:context(host):get_option_string("easy_invite_page_module", "invites_page");
+	if modulemanager.get_modules_for_host(host):contains(invites_page_module) then
+		module:context(host):depends(invites_page_module);
+	end
 
 	table.remove(arg, 1);
 	table.remove(arg, 1);