Mercurial > prosody-hg
diff plugins/mod_admin_shell.lua @ 14000:071779f7645c
Merge 13.0->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 05 Dec 2025 17:53:52 +0100 |
| parents | d539016e6b21 5ad86978ae78 |
| children | 0dd917830523 |
line wrap: on
line diff
--- a/plugins/mod_admin_shell.lua Fri Dec 05 17:51:21 2025 +0100 +++ b/plugins/mod_admin_shell.lua Fri Dec 05 17:53:52 2025 +0100 @@ -2097,8 +2097,8 @@ describe_command [[xmpp:ping(localjid, remotejid) - Sends a ping to an XMPP entity and reports the response]] local new_id = require "prosody.util.id".medium; function def_env.xmpp:ping(localjid, remotejid, timeout) - local localhost, localresource = select(2, jid_split(localjid)); - local remotehost = select(2, jid_split(remotejid)); + local localnode, localhost, localresource = jid_split(localjid); + local remotenode, remotehost, remoteresource = jid_split(remotejid); if not localhost then return nil, "Invalid sender JID"; elseif not prosody.hosts[localhost] then @@ -2109,7 +2109,7 @@ if not remotehost then return nil, "Invalid destination JID"; end - local iq = st.iq{ from=localjid, to=remotejid, type="get", id=new_id()} + local iq = st.iq { from = jid_join(localnode, localhost); to = jid_join(remotenode, remotehost, remoteresource); type = "get"; id = new_id() } :tag("ping", {xmlns="urn:xmpp:ping"}); local time_start = time.now(); local print = self.session.print;
