aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_roster.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2008-10-26 13:19:09 +0000
committerMatthew Wild <mwild1@gmail.com>2008-10-26 13:19:09 +0000
commit4d5a2486b5e283a4d464fd19b74c2500903a009c (patch)
tree6a4bedaa461bcac7f7c4921d752fd49fb2efa1b8 /plugins/mod_roster.lua
parent08940b23081e7328f25099816f54e8bcd9d280ae (diff)
parent1746f7eea0135b89a4f871d11c71cded04c4c0c3 (diff)
downloadprosody-4d5a2486b5e283a4d464fd19b74c2500903a009c.tar.gz
prosody-4d5a2486b5e283a4d464fd19b74c2500903a009c.zip
Merge presence/subscription support from waqas
Diffstat (limited to 'plugins/mod_roster.lua')
-rw-r--r--plugins/mod_roster.lua21
1 files changed, 12 insertions, 9 deletions
diff --git a/plugins/mod_roster.lua b/plugins/mod_roster.lua
index d02f77a5..1ccaafd0 100644
--- a/plugins/mod_roster.lua
+++ b/plugins/mod_roster.lua
@@ -16,14 +16,16 @@ add_iq_handler("c2s", "jabber:iq:roster",
local roster = st.reply(stanza)
:query("jabber:iq:roster");
for jid in pairs(session.roster) do
- roster:tag("item", {
- jid = jid,
- subscription = session.roster[jid].subscription,
- ask = session.roster[jid].ask,
- name = session.roster[jid].name,
- });
- for group in pairs(session.roster[jid].groups) do
- roster:tag("group"):text(group):up();
+ if jid ~= "pending" then
+ roster:tag("item", {
+ jid = jid,
+ subscription = session.roster[jid].subscription,
+ ask = session.roster[jid].ask,
+ name = session.roster[jid].name,
+ });
+ for group in pairs(session.roster[jid].groups) do
+ roster:tag("group"):text(group):up();
+ end
end
end
send(session, roster);
@@ -32,7 +34,8 @@ add_iq_handler("c2s", "jabber:iq:roster",
elseif stanza.attr.type == "set" then
local query = stanza.tags[1];
if #query.tags == 1 and query.tags[1].name == "item"
- and query.tags[1].attr.xmlns == "jabber:iq:roster" and query.tags[1].attr.jid then
+ and query.tags[1].attr.xmlns == "jabber:iq:roster" and query.tags[1].attr.jid
+ and query.tags[1].attr.jid ~= "pending" then
local item = query.tags[1];
local from_node, from_host = jid_split(stanza.attr.from);
local node, host, resource = jid_split(item.attr.jid);