# HG changeset patch # User Kim Alvefur # Date 1638018955 -3600 # Node ID 848a522fd731c05182fd710bed110f8bfc16034c # Parent b78a341e72e7d0b615033edd0a2242c7cc949b4d mod_admin_shell: Remove now redundant promise awaiting in xmpp:ping() diff -r b78a341e72e7 -r 848a522fd731 plugins/mod_admin_shell.lua --- a/plugins/mod_admin_shell.lua Sat Nov 27 12:53:56 2021 +0100 +++ b/plugins/mod_admin_shell.lua Sat Nov 27 14:15:55 2021 +0100 @@ -1350,12 +1350,9 @@ 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 = {};