Comparison

plugins/mod_groups.lua @ 3054:05b45b1281aa

mod_groups: Remove potentially verbose per-contact logging (thanks Flo)
author Matthew Wild <mwild1@gmail.com>
date Thu, 20 May 2010 09:40:33 +0100
parent 2925:692b3c6c5bd2
child 3125:f2d1079a758d
comparison
equal deleted inserted replaced
3051:15150ad771df 3054:05b45b1281aa
16 local jid_bare, jid_prep = jid.bare, jid.prep; 16 local jid_bare, jid_prep = jid.bare, jid.prep;
17 17
18 local module_host = module:get_host(); 18 local module_host = module:get_host();
19 19
20 function inject_roster_contacts(username, host, roster) 20 function inject_roster_contacts(username, host, roster)
21 module:log("warn", "Injecting group members to roster"); 21 --module:log("debug", "Injecting group members to roster");
22 local bare_jid = username.."@"..host; 22 local bare_jid = username.."@"..host;
23 if not members[bare_jid] and not members[false] then return; end -- Not a member of any groups 23 if not members[bare_jid] and not members[false] then return; end -- Not a member of any groups
24 24
25 local function import_jids_to_roster(group_name) 25 local function import_jids_to_roster(group_name)
26 for jid in pairs(groups[group_name]) do 26 for jid in pairs(groups[group_name]) do
39 end 39 end
40 40
41 -- Find groups this JID is a member of 41 -- Find groups this JID is a member of
42 if members[bare_jid] then 42 if members[bare_jid] then
43 for _, group_name in ipairs(members[bare_jid]) do 43 for _, group_name in ipairs(members[bare_jid]) do
44 module:log("debug", "Importing group %s", group_name); 44 --module:log("debug", "Importing group %s", group_name);
45 import_jids_to_roster(group_name); 45 import_jids_to_roster(group_name);
46 end 46 end
47 end 47 end
48 48
49 -- Import public groups 49 -- Import public groups
50 if members[false] then 50 if members[false] then
51 for _, group_name in ipairs(members[false]) do 51 for _, group_name in ipairs(members[false]) do
52 module:log("debug", "Importing group %s", group_name); 52 --module:log("debug", "Importing group %s", group_name);
53 import_jids_to_roster(group_name); 53 import_jids_to_roster(group_name);
54 end 54 end
55 end 55 end
56 56
57 if roster[false] then 57 if roster[false] then