# HG changeset patch # User Kim Alvefur # Date 1736320262 -3600 # Node ID 6e5124f72e9a7053992e1acd4e4241577fc9d891 # Parent 5033029130f513cfaec12eb74353b8e0bf44ffcb 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. diff -r 5033029130f5 -r 6e5124f72e9a plugins/mod_admin_shell.lua --- a/plugins/mod_admin_shell.lua Tue Jan 07 23:37:41 2025 +0100 +++ b/plugins/mod_admin_shell.lua Wed Jan 08 08:11:02 2025 +0100 @@ -2543,7 +2543,7 @@ 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 ""; + local mod_name = event.source and ("mod_"..event.source.name) or ""; 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;