Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protect: prompt if the user has asked the protecting admin about the … #586

Closed
wants to merge 2 commits into from

Conversation

MusikAnimal
Copy link
Collaborator

…protection when requesting unprotection

Prevent tracking down logs of circular page moves, some refactoring

Record if there was a stable log even if it's not currently pc protected

…protection when requesting unprotection

Prevent tracking down logs of circular page moves, some refactoring

Record if there was a stable log even if it's not currently pc protected
@MusikAnimal
Copy link
Collaborator Author

@Amorymeltzer Alright here you are :) Sorry it took me a month to respond to you, and moreover for that major major fuckup of force-pushing back to origin/master (which I've since fixed)!

Copy link
Collaborator

@Amorymeltzer Amorymeltzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MusikAnimal Here's what I got, now that moves enter the PC log (https://phabricator.wikimedia.org/T59912). The timing is fortuitous — I fixed up some redirects from a pending changes-protected page move vandal the other day, so this was fresh on my mind.

Having just done all this, I noticed it was a main repo branch so I could've just pushed on top of that. Or uploaded a file here? Alas. If you'd prefer looking over my changes that way, can do!

modules/twinkleprotect.js Outdated Show resolved Hide resolved
modules/twinkleprotect.js Outdated Show resolved Hide resolved
modules/twinkleprotect.js Outdated Show resolved Hide resolved
modules/twinkleprotect.js Outdated Show resolved Hide resolved
modules/twinkleprotect.js Outdated Show resolved Hide resolved
modules/twinkleprotect.js Show resolved Hide resolved
modules/twinkleprotect.js Outdated Show resolved Hide resolved
modules/twinkleprotect.js Show resolved Hide resolved
modules/twinkleprotect.js Show resolved Hide resolved
@@ -1159,7 +1214,11 @@ Twinkle.protect.callback.evaluate = function twinkleprotectCallbackEvaluate(e) {
typename = 'create protection';
break;
case 'unprotect':
/* falls through */
var admins = $.map(Twinkle.protect.currentProtectionLevels, function(pl) { return pl.admin ? 'User:' + pl.admin : null; });
if (admins.length && !confirm('Have you attempted to contact the protecting admins (' + $.unique(admins).join(', ') + ') first?' )) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about doing a whole thing here for admin vs admins, but most of the good functions are in ES6 and it's just not really worth it.

@@ -132,6 +157,10 @@ Twinkle.protect.fetchProtectionLevel = function twinkleprotectFetchProtectionLev
expiry: protection.expiry,
cascade: protection.cascade === ''
};
// logs report last admin who made changes to either edit/move/create protection, regardless if they only modified one of them
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I look forward to getting a bug report about this!

Amorymeltzer pushed a commit to Amorymeltzer/twinkle that referenced this pull request Apr 25, 2019
…protection when requesting unprotection

Prevent tracking down logs of circular page moves, some refactoring

Record if there was a stable log even if it's not currently pc protected

As noted, logevents reports the sysop who last modified protection for both edit and move, even if they only modified one

Close wikimedia-gadgets#586
@Amorymeltzer Amorymeltzer added this to the May update milestone May 5, 2019
@Amorymeltzer Amorymeltzer deleted the ask-protecting-admin branch May 13, 2019 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants