# HG changeset patch # User Myhailo Danylenko # Date 1237604686 -7200 # Node ID 7c22b1f2c6e5624d95b01705fdd6a403a1e45d6e # Parent 18d801679feb12e48ecae00729e0f1675f4eb167 Iq separation diff -r 18d801679feb -r 7c22b1f2c6e5 examples/ibb.lua --- 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 = { diff -r 18d801679feb -r 7c22b1f2c6e5 examples/iq.lua --- /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: --