--- 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 = {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/iq.lua Sat Mar 21 05:04:46 2009 +0200
@@ -0,0 +1,30 @@
+
+-- CORE, IQ
+
+-- library
+
+require 'lm'
+
+-- public
+
+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 ( mess )
+ elseif smtype == 'error' then
+ fail ( mess:child( 'error' ):children():name () ) -- FIXME
+ else
+ fail ( mess:xml () )
+ return false
+ end
+ return true
+ end )
+end
+
+-- vim: se ts=4: --