Changes
make the category attempt order more configurable
--[[
-- Define the initial order to test properties in. The subtable position
-- is the order the properties will be tested in, and the pos keypos value in
-- each subtable is the position of the value in the category key.
--]]
local properties = {
expiry = {pos order = 1, keypos = 5, val = expiry}, namespace = {'namespace'order = 2, pos keypos = 3, val = p.matchNamespace(namespace)}, reason = {pos order = 3, keypos = 4, val = reason}, level = {pos order = 4, keypos = 2, val = level}, action = {pos order = 5, keypos = 1, val = action}
}
-- vandalism categories if they were available.
--]]
local reasonTable = cfg.reasons[reason] local categoryOrder = reasonTable and reasonTable.categoryOrder local categoryOrderType = type(categoryOrder) local configOrder = {} if not reason categoryOrderType == 'table' then local dupes = {} for i = 1, 5 do local propertiesKey = categoryOrder [i] if not propertiesKey then error('no properties key') end local property = properties[propertiesKey] if not property then error('reasoninvalid properties key') end if dupes[property] then error('dupe detected') else dupes[property] = true end configOrder[i] = property end
else
end
--]]
local active, inactive = {}, {}
for i, t in ipairs(propertiesconfigOrder) do
if t.val then
active[#active + 1] = t
local key = {}
for j, t in ipairs(attemptOrder) do
if j > noActive then
key[post.keypos] = 'all'
else
local quotient = i / 2 ^ (j - 1)
quotient = ceil(quotient)
if quotient % 2 == 1 then
key[post.keypos] = t.val
else
key[post.keypos] = 'all'
end
end