author | Myhailo Danylenko <isbear@ukrpost.net> |
Mon, 23 Mar 2009 02:00:57 +0200 | |
changeset 54 | b53355736057 |
parent 49 | 95f3bf77c598 |
child 64 | bf7521ed96eb |
permissions | -rw-r--r-- |
-- 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 (), mess ) -- FIXME else fail ( mess:xml (), mess ) return false end return true end ) end -- vim: se ts=4: --