aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2008-10-26 00:22:18 +0500
committerWaqas Hussain <waqas20@gmail.com>2008-10-26 00:22:18 +0500
commit1746f7eea0135b89a4f871d11c71cded04c4c0c3 (patch)
tree0f93eb24de08f2ee9bc8fc09cf35731288b5fe5b /plugins
parent091e961c40b6d89f548efecea07e641e3f9c4210 (diff)
downloadprosody-1746f7eea0135b89a4f871d11c71cded04c4c0c3.tar.gz
prosody-1746f7eea0135b89a4f871d11c71cded04c4c0c3.zip
Bug fixes and checks for presence subscriptions, etc
Diffstat (limited to 'plugins')
-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);