|
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 |