Comparison

plugins/vcard.lua @ 195:dc61684e8dbf

plugins.vcard: Get and set vcard-temp info.
author Kim Alvefur <zash@zash.se>
date Thu, 17 Mar 2011 00:50:02 +0100
child 228:c5a4f82e2fd6
comparison
equal deleted inserted replaced
194:651c696e0b21 195:dc61684e8dbf
1 local xmlns_vcard = "vcard-temp";
2
3 -- TODO Should this plugin perhaps convert to/from some non-stanza format?
4 -- {
5 -- FN = "Kim Alvefur";
6 -- NICKNAME = "Zash";
7 -- }
8
9 function verse.plugins.vcard(stream)
10 function stream:get_vcard(jid, callback) --jid = nil for self
11 stream:send_iq(verse.iq({to = jid, type="get"})
12 :tag("vCard", {xmlns=xmlns_vcard}), callback);
13 end -- FIXME This should pick out the vCard element
14
15 function stream:set_vcard(vCard, callback)
16 stream:send_iq(verse.iq({type="set"})
17 :tag("vCard", {xmlns=xmlns_vcard})
18 :add_child(vCard), callback);
19 end
20 end