examples/ibb.lua
changeset 43 7c22b1f2c6e5
parent 41 9e39fd8a20df
child 51 a95a3a73482c
--- a/examples/ibb.lua	Sat Mar 21 03:44:07 2009 +0200
+++ b/examples/ibb.lua	Sat Mar 21 05:04:46 2009 +0200
@@ -4,28 +4,9 @@
 -- library
 
 require 'lm'
+require 'iq'
 require 'base64'
 
-iq = { }
-
-function iq.send ( conn, to, smtype, data, success, fail )
-	data.mtype = 'iq-' .. smtype
-	data.to    = to
-	conn:send ( lm.message.create ( data ),
-		function ( conn, mess )
-			local mtype, smtype = mess:type ()
-			if smtype == 'result' then
-				success ()
-			elseif smtype == 'error' then
-				fail ( mess:child( 'error' ):children():name () ) -- FIXME
-			else
-				fail ( mess:xml () )
-				return false
-			end
-			return true
-		end )
-end
-
 -- public
 
 ibb = {