Software /
code /
prosody
Changeset
13488:b2b090181270 0.12
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.
Backport of 430333198e4c
Fixes #1857
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 31 Mar 2023 22:01:27 +0200 |
parents | 13487:84fa880bf476 |
children | 13489:ae65f199f408 13492:dbf6e5404c7f |
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 Sat Apr 27 15:55:23 2024 +0200 +++ b/plugins/mod_admin_shell.lua Fri Mar 31 22:01:27 2023 +0200 @@ -25,7 +25,7 @@ local unpack = table.unpack or unpack; -- luacheck: ignore 113 local iterators = require "util.iterators"; local keys, values = iterators.keys, iterators.values; -local jid_bare, jid_split, jid_join = import("util.jid", "bare", "prepped_split", "join"); +local jid_bare, jid_split, jid_join, jid_compare = import("util.jid", "bare", "prepped_split", "join", "compare"); local set, array = require "util.set", require "util.array"; local cert_verify_identity = require "util.x509".verify_identity; local envload = require "util.envload".envload; @@ -940,7 +940,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;