Software /
code /
verse
Annotate
plugins/roster.lua @ 155:9c9af7a196ed
plugins.private, squishy: Allow setting the storage node, and not just child(s). And add to squishy.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 20 Nov 2010 17:27:03 +0100 |
parent | 82:f306c2f8bb88 |
child | 192:d20feb8034f5 |
rev | line source |
---|---|
82
f306c2f8bb88
plugins.roster: Unfinished roster plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
1 local xmlns_roster = "jabber:iq:roster"; |
f306c2f8bb88
plugins.roster: Unfinished roster plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
2 |
f306c2f8bb88
plugins.roster: Unfinished roster plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
3 function verse.plugins.roster(stream) |
f306c2f8bb88
plugins.roster: Unfinished roster plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
4 function stream:roster_add(jid, callback) |
f306c2f8bb88
plugins.roster: Unfinished roster plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
5 self:send_iq(verse.iq({ type = "set" }) |
f306c2f8bb88
plugins.roster: Unfinished roster plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
6 :tag("query", { xmlns = xmlns_roster }) |
f306c2f8bb88
plugins.roster: Unfinished roster plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
7 :tag("item", { jid = jid }), function () |
f306c2f8bb88
plugins.roster: Unfinished roster plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
8 callback(); |
f306c2f8bb88
plugins.roster: Unfinished roster plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
9 end); |
f306c2f8bb88
plugins.roster: Unfinished roster plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
10 end |
f306c2f8bb88
plugins.roster: Unfinished roster plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
11 |
f306c2f8bb88
plugins.roster: Unfinished roster plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
12 function stream:roster_fetch(callback) |
f306c2f8bb88
plugins.roster: Unfinished roster plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
13 self:send_iq(verse.iq({type="get"}):tag("query", { xmlns = xmlns_roster }), |
f306c2f8bb88
plugins.roster: Unfinished roster plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
14 function (result) |
f306c2f8bb88
plugins.roster: Unfinished roster plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
15 --TODO: Pass parsed roster to callback |
f306c2f8bb88
plugins.roster: Unfinished roster plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
16 callback(result); |
f306c2f8bb88
plugins.roster: Unfinished roster plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
17 end); |
f306c2f8bb88
plugins.roster: Unfinished roster plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
18 end |
f306c2f8bb88
plugins.roster: Unfinished roster plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
19 end |