From 769a3ed263b5ff865bdac6bd6ccaf54ca650b8f6 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 27 Nov 2021 14:15:55 +0100 Subject: mod_admin_shell: Remove now redundant promise awaiting in xmpp:ping() --- plugins/mod_admin_shell.lua | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'plugins') diff --git a/plugins/mod_admin_shell.lua b/plugins/mod_admin_shell.lua index 2cdea60d..abfade16 100644 --- a/plugins/mod_admin_shell.lua +++ b/plugins/mod_admin_shell.lua @@ -1350,12 +1350,9 @@ function def_env.xmpp:ping(localhost, remotehost, timeout) local iq = st.iq{ from=localhost, to=remotehost, type="get", id=new_id()} :tag("ping", {xmlns="urn:xmpp:ping"}); local time_start = time.now(); - local ret, err = async.wait_for(module:context(localhost):send_iq(iq, nil, timeout)); - if ret then - return true, ("pong from %s in %gs"):format(ret.stanza.attr.from, time.now() - time_start); - else - return false, tostring(err); - end + return module:context(localhost):send_iq(iq, nil, timeout):next(function (pong) + return ("pong from %s in %gs"):format(pong.stanza.attr.from, time.now() - time_start); + end); end def_env.dns = {}; -- cgit v1.2.3