Software /
code /
verse
Annotate
plugins/roster.lua @ 169:4bb1e9c91fbe
plugins.legacy: Try to login anyways, compat for servers not supporting XEP 78 properly.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 15 Dec 2010 15:03:46 +0000 |
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 |