plugins.ping: Reply to pings

Sat, 11 May 2013 18:42:13 +0200

author
Kim Alvefur <zash@zash.se>
date
Sat, 11 May 2013 18:42:13 +0200
changeset 339
72fbfb0367e9
parent 338
957704bbe9a1
child 340
0ce227f6034c

plugins.ping: Reply to pings

plugins/ping.lua file | annotate | diff | comparison | revisions
--- a/plugins/ping.lua	Fri May 10 12:19:57 2013 +0200
+++ b/plugins/ping.lua	Sat May 11 18:42:13 2013 +0200
@@ -17,5 +17,8 @@
 				callback(socket.gettime()-t, jid);
 			end);
 	end
+	stream:hook("iq/"..xmlns_ping, function(stanza)
+		return stream:send(verse.reply(stanza));
+	end);
 	return true;
 end

mercurial