Software /
code /
prosody
Comparison
plugins/mod_roster.lua @ 3540:bc139431830b
Monster whitespace commit (beware the whitespace monster).
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sat, 16 Oct 2010 23:00:42 +0500 |
parent | 3526:69a8c7e635c5 |
child | 4265:d56c26c258e4 |
comparison
equal
deleted
inserted
replaced
3539:8bbd965267b2 | 3540:bc139431830b |
---|---|
61 session.send(roster); | 61 session.send(roster); |
62 session.interested = true; -- resource is interested in roster updates | 62 session.interested = true; -- resource is interested in roster updates |
63 else -- stanza.attr.type == "set" | 63 else -- stanza.attr.type == "set" |
64 local query = stanza.tags[1]; | 64 local query = stanza.tags[1]; |
65 if #query.tags == 1 and query.tags[1].name == "item" | 65 if #query.tags == 1 and query.tags[1].name == "item" |
66 and query.tags[1].attr.xmlns == "jabber:iq:roster" and query.tags[1].attr.jid | 66 and query.tags[1].attr.xmlns == "jabber:iq:roster" and query.tags[1].attr.jid |
67 -- Protection against overwriting roster.pending, until we move it | 67 -- Protection against overwriting roster.pending, until we move it |
68 and query.tags[1].attr.jid ~= "pending" then | 68 and query.tags[1].attr.jid ~= "pending" then |
69 local item = query.tags[1]; | 69 local item = query.tags[1]; |
70 local from_node, from_host = jid_split(stanza.attr.from); | 70 local from_node, from_host = jid_split(stanza.attr.from); |
71 local from_bare = from_node and (from_node.."@"..from_host) or from_host; -- bare JID | 71 local from_bare = from_node and (from_node.."@"..from_host) or from_host; -- bare JID |
101 r_item.subscription = session.roster[jid].subscription; | 101 r_item.subscription = session.roster[jid].subscription; |
102 r_item.ask = session.roster[jid].ask; | 102 r_item.ask = session.roster[jid].ask; |
103 else | 103 else |
104 r_item.subscription = "none"; | 104 r_item.subscription = "none"; |
105 end | 105 end |
106 for _, child in ipairs(item) do | 106 for _, child in ipairs(item) do |
107 if child.name == "group" then | 107 if child.name == "group" then |
108 local text = t_concat(child); | 108 local text = t_concat(child); |
109 if text and text ~= "" then | 109 if text and text ~= "" then |
110 r_item.groups[text] = true; | 110 r_item.groups[text] = true; |
111 end | 111 end |