Changes
add namespace parser
['pc-autoconfirmed-all-all-all'] = 'Wikipedia pending changes protected pages (level 1)',
['pc-reviewer-all-all-all'] = 'Wikipedia pending changes protected pages (level 2)',
}
local nskeys = {
[2] = 'user',
[3] = 'user',
[4] = 'project',
[6] = 'file',
[10] = 'template',
[12] = 'project',
[14] = 'category',
[100] = 'portal',
}
end
function p.matchCategoryparseNamespace(cats, protType, protLevel, namespace, expiry, reasonns) local function isValidCat(t) --[[ -- Does a first parse over The ns variable is the categories, removing any that explicitly -- name a wrong parameternamespace number. This accounts for the majority of all of the -- categories. -- -- We check the parameters most likely to be wrong first. This saves on -- table lookups, which shoud make the function faster. --]] local testType, testLevel, testNs, testExpiry, testReason testReason = t.reason if testReason and testReason ~= reason then return false end testNs = t.namespace if testNs and not testNs[namespace] then return false end testExpiry = t.expiry if testExpiry and testExpiry ~= expiry then return false end testLevel = t.level if testLevel and testLevel ~= protLevel then return false end testType = t.ns or type if testType and testType (ns) ~= protType 'number' then return false end return true'all'
end
end
return nskey
end
end
return p