examples/mc_ping.lua
changeset 68 742878c74b8e
parent 67 d33ca5572e91
child 69 ab6d4ee8974c
--- a/examples/mc_ping.lua	Sat Mar 28 19:43:12 2009 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-
-local lm   = require 'lm'
-local ping = require 'ping'
-
-main.command ( 'ping',
-	function ( args )
-		local who
-		if args[1] then
-			who = args[1]
-		else
-			who = main.full_jid ()
-		end
-		local time = os.time ()
-		ping.send ( lm.connection.bless ( main.connection () ), who,
-			function ()
-				main.print_info ( who, ('Pong: %d seconds'):format ( os.time () - time ) )
-			end,
-			function ( mesg )
-				main.print_info ( who, 'Ping failed: ' .. mesg )
-			end )
-	end, true, 'jid' )
-
---[[
-local ping_handler = lm.message_handler.new ( ping.iq_handler )
-local ping_handler_registered = false
-
-hooks_d['hook-post-connect'].ping =
-	function ( args )
-		lm.connection.bless( main.connection () ):handler ( ping_handler, 'iq', 'normal' )
-		ping_handler_registered = true
-		hooks_d['hook-post-connect'].ping = nil
-		hooks_d['hook-quit'].ping =
-			function ( args )
-				if ping_handler_registered then
-					lm.connection.bless( main.connection () ):handler ( ping_handler, 'iq' )
-				end
-			end
-	end
-
-main.add_feature ( 'urn:xmpp:ping' )
---]]
-
--- vim: se ts=4: --