|
1 local xmlns_roster = "jabber:iq:roster"; |
|
2 |
|
3 function verse.plugins.roster(stream) |
|
4 function stream:roster_add(jid, callback) |
|
5 self:send_iq(verse.iq({ type = "set" }) |
|
6 :tag("query", { xmlns = xmlns_roster }) |
|
7 :tag("item", { jid = jid }), function () |
|
8 callback(); |
|
9 end); |
|
10 end |
|
11 |
|
12 function stream:roster_fetch(callback) |
|
13 self:send_iq(verse.iq({type="get"}):tag("query", { xmlns = xmlns_roster }), |
|
14 function (result) |
|
15 --TODO: Pass parsed roster to callback |
|
16 callback(result); |
|
17 end); |
|
18 end |
|
19 end |