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

arv: censor username if offensive username is ticked #1946

Merged
merged 7 commits into from
Sep 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion modules/twinklearv.js
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ Twinkle.arv.callback.evaluate = function(e) {
// Report inappropriate username
case 'username':
types = form.getChecked('arvtype').map(Morebits.string.toLowerCaseFirstChar);
var censorUsername = types.includes('offensive'); // check if the username is marked offensive

// generate human-readable string, e.g. "misleading and promotional username"
if (types.length <= 2) {
Expand Down Expand Up @@ -640,7 +641,7 @@ Twinkle.arv.callback.evaluate = function(e) {
return;
}
uaaPage.getStatusElement().status('Adding new report...');
uaaPage.setEditSummary('Reporting [[Special:Contributions/' + uid + '|' + uid + ']].');
uaaPage.setEditSummary('Reporting ' + (censorUsername ? 'an offensive username.' : '[[Special:Contributions/' + uid + '|' + uid + ']].'));
uaaPage.setChangeTags(Twinkle.changeTags);

// Blank newline per [[Special:Permalink/996949310#Spacing]]; see also [[WP:LISTGAP]] and [[WP:INDENTGAP]]
Expand Down
Loading