Lm separation, privacy
* Library parts moved to lm.*
* mc_* renamed to plain names
* Privacy lists suppart (not tested)
-- XMPP PING (XEP-0199)
-- library
local lm = require 'lm'
local iq = require 'lm.iq'
--
local F = { }
function F.send ( conn, to, success, fail )
iq.send ( conn, to, 'get',
{
ping = { xmlns = 'urn:xmpp:ping' },
}, success, fail )
end
function F.iq_handler ( conn, mess )
local mtype, smtype = mess:type ()
if smtype == 'get' then
local p = mess:child ( 'ping' )
if p and p:attribute ( 'xmlns' ) == 'urn:xmpp:ping' then
conn:send ( lm.message.create { mtype = 'iq-result', to = mess:attribute ( 'from' ), id = mess:attribute ( 'id' ) } )
return true
end
end
return false
end
return F
-- vim: se ts=4: --