riddim.plugins.ping: Handle JID being unknown after "resolving"

Sun, 27 May 2018 17:34:33 +0200

author
Kim Alvefur <zash@zash.se>
date
Sun, 27 May 2018 17:34:33 +0200
changeset 144
68dc84e72bef
parent 143
bad1be5e4674
child 145
565c0c43b063

riddim.plugins.ping: Handle JID being unknown after "resolving"

plugins/ping.lua file | annotate | diff | comparison | revisions
--- a/plugins/ping.lua	Sun May 27 17:30:37 2018 +0200
+++ b/plugins/ping.lua	Sun May 27 17:34:33 2018 +0200
@@ -6,6 +6,8 @@
 		local jid = command.param;
 		if jid then
 			jid = bot:resolvejid(jid, command.room);
+		end
+		if jid then
 			bot.stream:ping(jid, function (time, jid, error)
 				if time then
 					command:reply(string.format("Pong from %s in %0.3f seconds", jid, time));

mercurial