# HG changeset patch # User Kim Alvefur # Date 1300319402 -3600 # Node ID dc61684e8dbfaf016024f15e0a47872b2e45b2a1 # Parent 651c696e0b21176c03190c0ad3a9af5e83dcd749 plugins.vcard: Get and set vcard-temp info. diff -r 651c696e0b21 -r dc61684e8dbf plugins/vcard.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/vcard.lua Thu Mar 17 00:50:02 2011 +0100 @@ -0,0 +1,20 @@ +local xmlns_vcard = "vcard-temp"; + +-- TODO Should this plugin perhaps convert to/from some non-stanza format? +-- { +-- FN = "Kim Alvefur"; +-- NICKNAME = "Zash"; +-- } + +function verse.plugins.vcard(stream) + function stream:get_vcard(jid, callback) --jid = nil for self + stream:send_iq(verse.iq({to = jid, type="get"}) + :tag("vCard", {xmlns=xmlns_vcard}), callback); + end -- FIXME This should pick out the vCard element + + function stream:set_vcard(vCard, callback) + stream:send_iq(verse.iq({type="set"}) + :tag("vCard", {xmlns=xmlns_vcard}) + :add_child(vCard), callback); + end +end