Mon, 11 Feb 2013 00:00:49 +0100
clix.lua: Don't break if the disconnected event has no event data, and don't warn if the stream was closed cleanly
return function (opts, arg) if opts.short_help then print("Measure the round-trip latency time of a given JID"); return; end if #arg == 0 or opts.help then return 0; end local conn; local function on_reply(time, jid, reply) if time then print(string.format("%s latency: %1.3fs", jid, time)); else print("Error requesting ping ("..(reply.condition or "unknown")..")"..(reply.text and (": "..reply.text) or "")); end conn:close(); end local function on_connect(_conn) conn = _conn; conn:add_plugin("ping"); conn:ping(arg[1], on_reply); end clix_connect(opts, on_connect); end