diff options
author | Kim Alvefur <zash@zash.se> | 2019-09-29 18:44:58 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-09-29 18:44:58 +0200 |
commit | 469bfe7d6b3753aac14c9a576968391c94668e35 (patch) | |
tree | 09e99d4a6b85471cc5dd5b64e63bfaca24e82bf1 /plugins/mod_admin_telnet.lua | |
parent | 24b178651d59bb841090eb3d83f907172c98e0f4 (diff) | |
download | prosody-469bfe7d6b3753aac14c9a576968391c94668e35.tar.gz prosody-469bfe7d6b3753aac14c9a576968391c94668e35.zip |
mod_admin_telnet: Use new compact function for waiting on promises
Diffstat (limited to 'plugins/mod_admin_telnet.lua')
-rw-r--r-- | plugins/mod_admin_telnet.lua | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua index 5c08b8d1..24230257 100644 --- a/plugins/mod_admin_telnet.lua +++ b/plugins/mod_admin_telnet.lua @@ -1148,13 +1148,7 @@ function def_env.xmpp:ping(localhost, remotehost, timeout) end local iq = st.iq{ from=localhost, to=remotehost, type="get", id=new_id()} :tag("ping", {xmlns="urn:xmpp:ping"}); - local ret, err; - local wait, done = async.waiter(); - module:context(localhost):send_iq(iq, nil, timeout) - :next(function (ret_) ret = ret_; end, - function (err_) err = err_; end) - :finally(done); - wait(); + local ret, err = async.wait(module:context(localhost):send_iq(iq, nil, timeout)); if ret then return true, "pong from " .. ret.stanza.attr.from; else |