Mercurial > prosody-hg
diff plugins/mod_pubsub/commands.lib.lua @ 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 | e226f9632a48 |
| children |
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
