# HG changeset patch # User Kim Alvefur # Date 1680292887 -7200 # Node ID 430333198e4cb0b87c2b669cda988f71204a4df2 # Parent c2616274bef76fed56bf3b2c7ae627f294c5217e 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. diff -r c2616274bef7 -r 430333198e4c plugins/mod_admin_shell.lua --- 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;