diff options
author | Kim Alvefur <zash@zash.se> | 2023-02-16 20:15:39 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2023-02-16 20:15:39 +0100 |
commit | 02b01c48265d550c0fdc0521cdc4a86e6aad94c1 (patch) | |
tree | 1daa0881ded9ab27692b887ea2e0275e6700328a | |
parent | 424a33445072c34d1239da75b7faa2d6276a2ebd (diff) | |
parent | 67ea0ee50ecd5886099e639f847acff9f28fd6e2 (diff) | |
download | prosody-02b01c48265d550c0fdc0521cdc4a86e6aad94c1.tar.gz prosody-02b01c48265d550c0fdc0521cdc4a86e6aad94c1.zip |
Merge 0.12->trunk
-rw-r--r-- | plugins/mod_admin_shell.lua | 1 | ||||
-rw-r--r-- | plugins/mod_admin_socket.lua | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/plugins/mod_admin_shell.lua b/plugins/mod_admin_shell.lua index f8b5fd1c..c03a74b8 100644 --- a/plugins/mod_admin_shell.lua +++ b/plugins/mod_admin_shell.lua @@ -210,6 +210,7 @@ module:hook("admin/repl-input", function (event) if not ok then event.origin.send(st.stanza("repl-result", { type = "error" }):text(err)); end + return true; end); -- Console commands -- diff --git a/plugins/mod_admin_socket.lua b/plugins/mod_admin_socket.lua index 38947a44..fdf099db 100644 --- a/plugins/mod_admin_socket.lua +++ b/plugins/mod_admin_socket.lua @@ -19,6 +19,7 @@ end 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 @@ local function fire_admin_event(session, stanza) 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 () |