Software /
code /
verse
Annotate
plugins/roster.lua @ 88:e204ef45bdd6
Add doc/example_bosh.lua
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 06 Aug 2010 16:31:30 +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 |