Software /
code /
prosody
Changeset
13013:430333198e4c
mod_admin_shell: Allow matching on host or bare JID in c2s:show
Only supporting exact match on full JID isn't helpful if you want to
list sessions per host or user.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 31 Mar 2023 22:01:27 +0200 |
parents | 13012:c2616274bef7 |
children | 13014:06453c564141 |
files | plugins/mod_admin_shell.lua |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_admin_shell.lua Thu Mar 30 11:09:08 2023 +0200 +++ b/plugins/mod_admin_shell.lua Fri Mar 31 22:01:27 2023 +0200 @@ -25,7 +25,7 @@ local unpack = table.unpack; local iterators = require "prosody.util.iterators"; local keys, values = iterators.keys, iterators.values; -local jid_bare, jid_split, jid_join, jid_resource = import("prosody.util.jid", "bare", "prepped_split", "join", "resource"); +local jid_bare, jid_split, jid_join, jid_resource, jid_compare = import("prosody.util.jid", "bare", "prepped_split", "join", "resource", "compare"); local set, array = require "prosody.util.set", require "prosody.util.array"; local cert_verify_identity = require "prosody.util.x509".verify_identity; local envload = require "prosody.util.envload".envload; @@ -998,7 +998,7 @@ local function match(session) local jid = get_jid(session) - return (not match_jid) or jid == match_jid; + return (not match_jid) or jid_compare(jid, match_jid); end local group_by_host = true;