Skip to content

Commit

Permalink
arv: censor username if offensive username is ticked (wikimedia-gadge…
Browse files Browse the repository at this point in the history
…ts#1946)

* Issue wikimedia-gadgets#1945 Implementation

* why is vsc doing this

* Update twinklearv.js

* is this what the linter doesn't like?

* i'm sorry, please squash this

* fixed, sorry

* would have outputted as a double space,

i'm going to bed, i am so sorry.

---------

Co-authored-by: DarmaniLink <redacted>
  • Loading branch information
darmanilink authored and rustykitty committed Dec 1, 2024
1 parent 5ad6f74 commit f66208a
Showing 1 changed file with 2 additions and 1 deletion.
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

0 comments on commit f66208a

Please sign in to comment.