Software /
code /
prosody
Annotate
plugins/mod_roster.lua @ 102:a5b914370db5
Fixed: mod_roster now outputs all roster data (instead of just the JIDs)
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sun, 12 Oct 2008 17:41:14 +0500 |
parent | 79:2766e23c4d7d |
child | 108:1d79da482c5d |
rev | line source |
---|---|
30 | 1 |
2 local st = require "util.stanza" | |
3 local send = require "core.sessionmanager".send_to_session | |
4 | |
5 add_iq_handler("c2s", "jabber:iq:roster", | |
6 function (session, stanza) | |
7 if stanza.attr.type == "get" then | |
8 local roster = st.reply(stanza) | |
9 :query("jabber:iq:roster"); | |
10 for jid in pairs(session.roster) do | |
102
a5b914370db5
Fixed: mod_roster now outputs all roster data (instead of just the JIDs)
Waqas Hussain <waqas20@gmail.com>
parents:
79
diff
changeset
|
11 local item = st.stanza("item", { |
a5b914370db5
Fixed: mod_roster now outputs all roster data (instead of just the JIDs)
Waqas Hussain <waqas20@gmail.com>
parents:
79
diff
changeset
|
12 jid = jid, |
a5b914370db5
Fixed: mod_roster now outputs all roster data (instead of just the JIDs)
Waqas Hussain <waqas20@gmail.com>
parents:
79
diff
changeset
|
13 subscription = session.roster[jid].subscription, |
a5b914370db5
Fixed: mod_roster now outputs all roster data (instead of just the JIDs)
Waqas Hussain <waqas20@gmail.com>
parents:
79
diff
changeset
|
14 name = session.roster[jid].name, |
a5b914370db5
Fixed: mod_roster now outputs all roster data (instead of just the JIDs)
Waqas Hussain <waqas20@gmail.com>
parents:
79
diff
changeset
|
15 }); |
a5b914370db5
Fixed: mod_roster now outputs all roster data (instead of just the JIDs)
Waqas Hussain <waqas20@gmail.com>
parents:
79
diff
changeset
|
16 for group in pairs(session.roster[jid].groups) do |
a5b914370db5
Fixed: mod_roster now outputs all roster data (instead of just the JIDs)
Waqas Hussain <waqas20@gmail.com>
parents:
79
diff
changeset
|
17 item:tag("group"):text(group):up(); |
a5b914370db5
Fixed: mod_roster now outputs all roster data (instead of just the JIDs)
Waqas Hussain <waqas20@gmail.com>
parents:
79
diff
changeset
|
18 end |
a5b914370db5
Fixed: mod_roster now outputs all roster data (instead of just the JIDs)
Waqas Hussain <waqas20@gmail.com>
parents:
79
diff
changeset
|
19 roster:add_child(item); |
30 | 20 end |
21 send(session, roster); | |
22 return true; | |
23 end | |
24 end); |