Comparison

plugins/mod_roster.lua @ 132:9a4aa57af367

Roster updates - Added support for item.ask attribute in rostermanager and mod_roster - Updated roster docs - Removed old code from rostermanager
author Waqas Hussain <waqas20@gmail.com>
date Thu, 23 Oct 2008 20:02:30 +0500
parent 114:bed2a8508cf5
child 177:606c433955e7
comparison
equal deleted inserted replaced
131:4bbbc7883ee6 132:9a4aa57af367
17 :query("jabber:iq:roster"); 17 :query("jabber:iq:roster");
18 for jid in pairs(session.roster) do 18 for jid in pairs(session.roster) do
19 roster:tag("item", { 19 roster:tag("item", {
20 jid = jid, 20 jid = jid,
21 subscription = session.roster[jid].subscription, 21 subscription = session.roster[jid].subscription,
22 ask = session.roster[jid].ask,
22 name = session.roster[jid].name, 23 name = session.roster[jid].name,
23 }); 24 });
24 for group in pairs(session.roster[jid].groups) do 25 for group in pairs(session.roster[jid].groups) do
25 roster:tag("group"):text(group):up(); 26 roster:tag("group"):text(group):up();
26 end 27 end
52 else 53 else
53 local r_item = {name = item.attr.name, groups = {}}; 54 local r_item = {name = item.attr.name, groups = {}};
54 if r_item.name == "" then r_item.name = nil; end 55 if r_item.name == "" then r_item.name = nil; end
55 if session.roster[item.attr.jid] then 56 if session.roster[item.attr.jid] then
56 r_item.subscription = session.roster[item.attr.jid].subscription; 57 r_item.subscription = session.roster[item.attr.jid].subscription;
58 r_item.ask = session.roster[item.attr.jid].ask;
57 else 59 else
58 r_item.subscription = "none"; 60 r_item.subscription = "none";
59 end 61 end
60 for _, child in ipairs(item) do 62 for _, child in ipairs(item) do
61 if child.name == "group" then 63 if child.name == "group" then