aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2023-04-07 14:03:24 +0200
committerKim Alvefur <zash@zash.se>2023-04-07 14:03:24 +0200
commit2fa6a010180e8879e1eaab6612d86ff74cbed182 (patch)
tree960232cd3b4e138a76784524b14f98a9ccfe50f4 /plugins
parent21eabc7e58844a969fcfc52067589429728294f4 (diff)
downloadprosody-2fa6a010180e8879e1eaab6612d86ff74cbed182.tar.gz
prosody-2fa6a010180e8879e1eaab6612d86ff74cbed182.zip
mod_admin_shell: Allow "*" as substitute for 'nil' for easier CLI usage
Since prosodyctl shell with additional arguments assumes the first two are a section:command() and any following arguments are strings, passing a bare 'nil' is not possible. In order to avoid delving into this rabbit hole, instead produce a token that alone is not really a legal JID for use as wildcard.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_admin_shell.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/mod_admin_shell.lua b/plugins/mod_admin_shell.lua
index be494d9f..15a41b55 100644
--- a/plugins/mod_admin_shell.lua
+++ b/plugins/mod_admin_shell.lua
@@ -1017,7 +1017,7 @@ function def_env.c2s:show(match_jid, colspec)
local function match(session)
local jid = get_jid(session)
- return (not match_jid) or jid_compare(jid, match_jid);
+ return (not match_jid) or match_jid == "*" or jid_compare(jid, match_jid);
end
local group_by_host = true;
@@ -1100,7 +1100,7 @@ function def_env.s2s:show(match_jid, colspec)
local function match(session)
local host, remote = get_s2s_hosts(session);
- return not match_jid or host == match_jid or remote == match_jid;
+ return not match_jid or match_jid == "*" or host == match_jid or remote == match_jid;
end
local group_by_host = true;