Software /
code /
prosody
Comparison
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 |
comparison
equal
deleted
inserted
replaced
101:c690fa382743 | 102:a5b914370db5 |
---|---|
6 function (session, stanza) | 6 function (session, stanza) |
7 if stanza.attr.type == "get" then | 7 if stanza.attr.type == "get" then |
8 local roster = st.reply(stanza) | 8 local roster = st.reply(stanza) |
9 :query("jabber:iq:roster"); | 9 :query("jabber:iq:roster"); |
10 for jid in pairs(session.roster) do | 10 for jid in pairs(session.roster) do |
11 roster:tag("item", { jid = jid, subscription = "none" }):up(); | 11 local item = st.stanza("item", { |
12 jid = jid, | |
13 subscription = session.roster[jid].subscription, | |
14 name = session.roster[jid].name, | |
15 }); | |
16 for group in pairs(session.roster[jid].groups) do | |
17 item:tag("group"):text(group):up(); | |
18 end | |
19 roster:add_child(item); | |
12 end | 20 end |
13 send(session, roster); | 21 send(session, roster); |
14 return true; | 22 return true; |
15 end | 23 end |
16 end); | 24 end); |