diff --git a/spihelper.js b/spihelper.js index b7ed7a3..4d293f4 100644 --- a/spihelper.js +++ b/spihelper.js @@ -1561,6 +1561,11 @@ async function spiHelperPerformActions () { if (mw.util.isIPAddress(globalLockEntry, true)) { return } + // skip if already globally locked + if (await spiHelperIsUserGloballyLocked(globalLockEntry)) { + return + } + templateContent += '|' + (matchCount + 1) + '=' + globalLockEntry if (locked) { locked += ', ' @@ -3004,6 +3009,7 @@ async function spiHelperGenerateBlockTableLine (name, defaultblock, id) { let block, ab, acb, ntp, nem, duration + const isIP = mw.util.isIPAddress(name, true) if (currentBlock) { block = true acb = currentBlock.acb @@ -3017,7 +3023,7 @@ async function spiHelperGenerateBlockTableLine (name, defaultblock, id) { ab = true ntp = spiHelperArchiveNoticeParams.notalk nem = spiHelperArchiveNoticeParams.notalk - duration = mw.util.isIPAddress(name, true) ? '1 week' : 'indefinite' + duration = isIP ? '1 week' : 'indefinite' } const $table = $('#spiHelper_blockTable', document) @@ -3053,7 +3059,7 @@ async function spiHelperGenerateBlockTableLine (name, defaultblock, id) { .val(name)).appendTo($row) // Global lock (disabled for IPs since they can't be locked) $('