Skip to content

Commit

Permalink
fluff: Don't add rollback links to the top history revision if there'…
Browse files Browse the repository at this point in the history
…s just one user

Closes wikimedia-gadgets#1062.

Only really makes sense if multiple consecutive revdel'd users are treated as one (wikimedia-gadgets#1069).
  • Loading branch information
Amorymeltzer authored and wiki-ST47 committed Sep 2, 2020
1 parent cdc3fd5 commit 1c74155
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion modules/twinklefluff.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,15 @@ Twinkle.fluff.addLinks = {
var first = histList.shift();
var vandal = $(first).find('.mw-userlink:not(.history-deleted)').text();

first.appendChild(Twinkle.fluff.linkBuilder.rollbackLinks(vandal, true));
// Check for first username different than the top user,
// only apply rollback links if/when found
// for faster than every
for (var i = 0; i < histList.length; i++) {
if ($(histList[i]).find('.mw-userlink').text() !== vandal) {
first.appendChild(Twinkle.fluff.linkBuilder.rollbackLinks(vandal, true));
break;
}
}
}

// oldid
Expand Down

0 comments on commit 1c74155

Please sign in to comment.