Changeset

12888:b8504b71735d

Merge 0.12->trunk
author Kim Alvefur <zash@zash.se>
date Thu, 16 Feb 2023 20:15:39 +0100
parents 12886:686c3cdd4775 (current diff) 12887:68df46926c26 (diff)
children 12890:05b3b3dc7326
files plugins/mod_admin_shell.lua plugins/mod_admin_socket.lua
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_admin_shell.lua	Thu Feb 16 16:00:07 2023 +0000
+++ b/plugins/mod_admin_shell.lua	Thu Feb 16 20:15:39 2023 +0100
@@ -210,6 +210,7 @@
 	if not ok then
 		event.origin.send(st.stanza("repl-result", { type = "error" }):text(err));
 	end
+	return true;
 end);
 
 -- Console commands --
--- a/plugins/mod_admin_socket.lua	Thu Feb 16 16:00:07 2023 +0000
+++ b/plugins/mod_admin_socket.lua	Thu Feb 16 20:15:39 2023 +0100
@@ -19,6 +19,7 @@
 local server = require "net.server";
 
 local adminstream = require "util.adminstream";
+local st = require "util.stanza";
 
 local socket_path = module:get_option_path("admin_socket", "prosody.sock", "data");
 
@@ -35,7 +36,11 @@
 		event_name = "admin/"..stanza.name;
 	end
 	module:log("debug", "Firing %s", event_name);
-	return module:fire_event(event_name, event_data);
+	local ret = module:fire_event(event_name, event_data);
+	if ret == nil then
+		session.send(st.stanza("repl-result", { type = "error" }):text("No module handled this query. Is mod_admin_shell enabled?"));
+	end
+	return ret;
 end
 
 module:hook("server-stopping", function ()