Mercurial > prosody-hg
changeset 14033:fe024a5be7e6 13.0
mod_pubsub/commands: Fix listing item numbers along with item names
The get_items method returns a table where integer keys carry the order
of items, while string keys carry item data, like { [1] = "item", ["item"] = {} }
The command should only print the item names, not the integer keys.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 12 Jan 2026 06:47:50 +0100 |
| parents | 04d7f2038933 |
| children | 6a25e8658a72 dab1a4002cb5 |
| files | plugins/mod_pubsub/commands.lib.lua |
| diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_pubsub/commands.lib.lua Sun Jan 04 17:58:26 2026 +0100 +++ b/plugins/mod_pubsub/commands.lib.lua Mon Jan 12 06:47:50 2026 +0100 @@ -44,7 +44,7 @@ local items = select(2, assert(service:get_items(node_name, true))); local count = 0; - for item_name in pairs(items) do + for _, item_name in ipairs(items) do count = count + 1; self.session.print(item_name); end
