Software /
code /
verse
Comparison
plugins/roster.lua @ 82:f306c2f8bb88
plugins.roster: Unfinished roster plugin
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 02 Jul 2010 13:36:18 +0100 |
child | 192:d20feb8034f5 |
comparison
equal
deleted
inserted
replaced
81:0924a3d05e40 | 82:f306c2f8bb88 |
---|---|
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 |