Matching reality rather than 2018 me's wishful thinking
m (1 revision imported) |
(Matching reality rather than 2018 me's wishful thinking) |
||
Line 77: | Line 77: | ||
local tsTitleObj = mw.title.new(ts) | local tsTitleObj = mw.title.new(ts) | ||
local tsProt = tsTitleObj.protectionLevels["edit"] and tsTitleObj.protectionLevels["edit"][1] or nil | local tsProt = tsTitleObj.protectionLevels["edit"] and tsTitleObj.protectionLevels["edit"][1] or nil | ||
if cfg['padlock_pattern'] and tsProt and not addedPadlockCat then | if cfg['padlock_pattern'] and tsProt and not addedPadlockCat then | ||
local content = tsTitleObj:getContent() | local content = tsTitleObj:getContent() | ||
Line 86: | Line 82: | ||
cats[#cats + 1] = cfg['missing_padlock_category'] | cats[#cats + 1] = cfg['missing_padlock_category'] | ||
addedPadlockCat = true | addedPadlockCat = true | ||
end | |||
end | |||
if cfg['protection_conflict_category'] and currentProt and tsProt ~= currentProt and not addedLevelCat then | |||
currentProt = cfg['protection_hierarchy'][currentProt] or 0 | |||
tsProt = cfg['protection_hierarchy'][tsProt] or 0 | |||
if tsProt < currentProt then | |||
addedLevelCat = true | |||
cats[#cats + 1] = cfg['protection_conflict_category'] | |||
end | end | ||
end | end |