comparison mod_blocking/mod_blocking.lua @ 177:bcd7dc51a5e3

mod_blocking: Fix to iterate over blocklist correctly when removing a JID
author Matthew Wild <mwild1@gmail.com>
date Mon, 14 Jun 2010 12:26:25 +0100
parents 26bb69a57749
children 4986ffe35704
comparison
equal deleted inserted replaced
176:26bb69a57749 177:bcd7dc51a5e3
69 if not default_list_name then return; end 69 if not default_list_name then return; end
70 local default_list = privacy_lists.lists[default_list_name]; 70 local default_list = privacy_lists.lists[default_list_name];
71 if not default_list then return; end 71 if not default_list then return; end
72 local items = default_list.items; 72 local items = default_list.items;
73 local item; 73 local item;
74 for i=#items,1 do -- order must be unique 74 for i=#items,1,-1 do -- order must be unique
75 item = items[i]; 75 item = items[i];
76 if item.type == "jid" and item.action == "deny" then 76 if item.type == "jid" and item.action == "deny" then
77 table.remove(items, i); 77 table.remove(items, i);
78 end 78 end
79 end 79 end