diff options
Diffstat (limited to 'plugins/mod_roster.lua')
-rw-r--r-- | plugins/mod_roster.lua | 21 |
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); |