diff options
author | Kim Alvefur <zash@zash.se> | 2025-01-08 08:11:02 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2025-01-08 08:11:02 +0100 |
commit | 63690dd4a04eef9e016558f6b69bab6c64b5473b (patch) | |
tree | ac4ffe56593a0f5e60d35eef232dbc6d610fffb2 /plugins | |
parent | 0fe28ddb09d912103fe38a957b5c0102d67263ac (diff) | |
download | prosody-63690dd4a04eef9e016558f6b69bab6c64b5473b.tar.gz prosody-63690dd4a04eef9e016558f6b69bab6c64b5473b.zip |
mod_admin_shell: Fix reporting origin module for commands
The field `_provided_by` comes from module:provides(), but these items
comes from moduel:add_item(), which include the originating module as a
'source' field of the event. However, this is absent when items are
retrieved at a later time than the initial event.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_admin_shell.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/mod_admin_shell.lua b/plugins/mod_admin_shell.lua index 4f8e6094..147c047f 100644 --- a/plugins/mod_admin_shell.lua +++ b/plugins/mod_admin_shell.lua @@ -2543,7 +2543,7 @@ local host_commands = {}; local function new_item_handlers(command_host) local function on_command_added(event) local command = event.item; - local mod_name = command._provided_by and ("mod_"..command._provided_by) or "<unknown module>"; + local mod_name = event.source and ("mod_"..event.source.name) or "<unknown module>"; if not schema.validate(command_metadata_schema, command) or type(command.handler) ~= "function" then module:log("warn", "Ignoring command added by %s: missing or invalid data", mod_name); return; |