changeset 14048:f5d415d54064

Merge 13.0->trunk
author Matthew Wild <mwild1@gmail.com>
date Tue, 20 Jan 2026 11:13:31 +0000
parents 76dba6ddf502 (current diff) f463e101fbd9 (diff)
children 04c3687b5641
files plugins/mod_mam/mod_mam.lua plugins/muc/mod_muc.lua util/prosodyctl/check.lua
diffstat 7 files changed, 45 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/core/modulemanager.lua	Mon Jan 19 12:09:40 2026 +0100
+++ b/core/modulemanager.lua	Tue Jan 20 11:13:31 2026 +0000
@@ -37,7 +37,7 @@
 	"s2s",
 	"s2s_auth_certs",
 };
-local component_inheritable_modules = {
+local default_component_inheritable_modules = {
 	"tls",
 	"saslauth",
 	"dialback",
@@ -46,6 +46,7 @@
 	"s2s_bidi",
 	"smacks",
 	"server_contact_info",
+	"admin_shell",
 };
 
 -- We need this to let modules access the real global namespace
@@ -128,7 +129,17 @@
 
 	local global_modules = set.new(autoload_modules) + set.new(global_modules_enabled) - set.new(global_modules_disabled);
 	if component then
-		global_modules = set.intersection(set.new(component_inheritable_modules), global_modules);
+		local component_inheritable_modules = set.new(default_component_inheritable_modules);
+		local ok, _, metadata = loader:load_resource(component);
+		if ok then
+			local extra_inheritable_modules = metadata.inherit_modules;
+			if extra_inheritable_modules then
+				for inherit_module in extra_inheritable_modules:gmatch("[^, ]+") do
+					component_inheritable_modules:add(inherit_module);
+				end
+			end
+		end
+		global_modules = set.intersection(component_inheritable_modules, global_modules);
 	end
 	local modules = (global_modules + set.new(host_modules_enabled)) - set.new(host_modules_disabled);
 
--- a/doc/doap.xml	Mon Jan 19 12:09:40 2026 +0100
+++ b/doc/doap.xml	Tue Jan 20 11:13:31 2026 +0000
@@ -913,5 +913,12 @@
         <xmpp:since>13.0.0</xmpp:since>
       </xmpp:SupportedXep>
     </implements>
+    <implements>
+      <xmpp:SupportedXep>
+        <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0486.html"/>
+        <xmpp:version>0.1.0</xmpp:version>
+        <xmpp:since>13.0.0</xmpp:since>
+      </xmpp:SupportedXep>
+    </implements>
   </Project>
 </rdf:RDF>
--- a/plugins/mod_account_activity.lua	Mon Jan 19 12:09:40 2026 +0100
+++ b/plugins/mod_account_activity.lua	Tue Jan 20 11:13:31 2026 +0000
@@ -69,11 +69,16 @@
 		for username in um.users(host) do
 			local last_active = store:get_key(username, "timestamp");
 			if not last_active then
-				local created_at = um.get_account_info(username, host).created;
-				if created_at and (now - created_at) > duration_sec then
-					self.session.print(username, "");
-					n_inactive = n_inactive + 1;
-				elseif not created_at then
+				local user_info = um.get_account_info(username, host);
+				local created_at;
+				if user_info then
+					created_at  = user_info.created;
+					if created_at and (now - created_at) > duration_sec then
+						self.session.print(username, "");
+						n_inactive = n_inactive + 1;
+					end
+				end
+				if not created_at then
 					n_unknown = n_unknown + 1;
 				end
 			elseif (now - last_active) > duration_sec then
--- a/plugins/mod_mam/mod_mam.lua	Mon Jan 19 12:09:40 2026 +0100
+++ b/plugins/mod_mam/mod_mam.lua	Tue Jan 20 11:13:31 2026 +0000
@@ -9,6 +9,11 @@
 -- XEP-0313: Message Archive Management for Prosody
 --
 
+if module:get_host_type() == "component" and module:get_option_string("component_module") == "muc" then
+	module:depends("muc_mam");
+	return;
+end
+
 local xmlns_mam     = "urn:xmpp:mam:2";
 local xmlns_mam_ext = "urn:xmpp:mam:2#extended";
 local xmlns_delay   = "urn:xmpp:delay";
--- a/plugins/mod_pubsub/mod_pubsub.lua	Mon Jan 19 12:09:40 2026 +0100
+++ b/plugins/mod_pubsub/mod_pubsub.lua	Tue Jan 20 11:13:31 2026 +0000
@@ -1,3 +1,7 @@
+if module:get_host_type() ~= "component" then
+	error("Pubsub should be loaded as a component, please see https://prosody.im/doc/modules/mod_pubsub", 0);
+end
+
 local pubsub = require "prosody.util.pubsub";
 local st = require "prosody.util.stanza";
 local jid_bare = require "prosody.util.jid".bare;
--- a/plugins/muc/mod_muc.lua	Mon Jan 19 12:09:40 2026 +0100
+++ b/plugins/muc/mod_muc.lua	Tue Jan 20 11:13:31 2026 +0000
@@ -5,6 +5,7 @@
 -- This project is MIT/X11 licensed. Please see the
 -- COPYING file in the source package for more information.
 --
+--% inherit_modules: mam
 
 -- Exposed functions:
 --
@@ -18,6 +19,7 @@
 -- live_rooms() -> room
 -- shutdown_component()
 
+
 if module:get_host_type() ~= "component" then
 	error("MUC should be loaded as a component, please see https://prosody.im/doc/components", 0);
 end
--- a/util/prosodyctl/check.lua	Mon Jan 19 12:09:40 2026 +0100
+++ b/util/prosodyctl/check.lua	Tue Jan 20 11:13:31 2026 +0000
@@ -475,7 +475,6 @@
 			"websocket_get_response_text",
 		});
 		local config = configmanager.getconfig();
-		local global = api("*");
 		-- Check that we have any global options (caused by putting a host at the top)
 		if it.count(it.filter("log", pairs(config["*"]))) == 0 then
 			ok = false;
@@ -538,9 +537,8 @@
 		end
 
 		do -- Check for modules enabled both normally and as components
-			local modules = global:get_option_set("modules_enabled");
-			for host, options in enabled_hosts() do
-				local component_module = options.component_module;
+			for host in enabled_hosts() do
+				local modules, component_module = modulemanager.get_modules_for_host(host);
 				if component_module and modules:contains(component_module) then
 					print(("    mod_%s is enabled both in modules_enabled and as Component %q %q"):format(component_module, host, component_module));
 					print("    This means the service is enabled on all VirtualHosts as well as the Component.");
@@ -1559,7 +1557,7 @@
 		};
 
 		local recommended_component_modules = {
-			muc = { "muc_mam" };
+			muc = { "mam" };
 		};
 
 		local function print_feature_status(feature, host)
@@ -1694,7 +1692,7 @@
 				for _, component_module in ipairs({ suggested, alternate, ... }) do
 					found = host_components[component_module][1];
 					if found then
-						local enabled_component_modules = api(found):get_option_inherited_set("modules_enabled");
+						local enabled_component_modules = modulemanager.get_modules_for_host(found);
 						local recommended_mods = recommended_component_modules[component_module];
 						if recommended_mods then
 							local missing_mods = {};