Comparison

plugins/mod_groups.lua @ 2913:3d4e814cadfa

mod_groups: Ignore whitespace on group member JID lines (thanks Luis!)
author Matthew Wild <mwild1@gmail.com>
date Mon, 22 Mar 2010 14:36:53 +0000
parent 2912:f5a5317f3485
child 2925:692b3c6c5bd2
comparison
equal deleted inserted replaced
2912:f5a5317f3485 2913:3d4e814cadfa
96 end 96 end
97 module:log("debug", "New group: %s", tostring(curr_group)); 97 module:log("debug", "New group: %s", tostring(curr_group));
98 groups[curr_group] = groups[curr_group] or {}; 98 groups[curr_group] = groups[curr_group] or {};
99 else 99 else
100 -- Add JID 100 -- Add JID
101 local jid = jid_prep(line); 101 local jid = jid_prep(line:match("%S+"));
102 if jid then 102 if jid then
103 module:log("debug", "New member of %s: %s", tostring(curr_group), tostring(jid)); 103 module:log("debug", "New member of %s: %s", tostring(curr_group), tostring(jid));
104 groups[curr_group][jid] = true; 104 groups[curr_group][jid] = true;
105 members[jid] = members[jid] or {}; 105 members[jid] = members[jid] or {};
106 members[jid][#members[jid]+1] = curr_group; 106 members[jid][#members[jid]+1] = curr_group;