Skip to content

Commit

Permalink
Merge pull request #137 from destinygg/banned-word
Browse files Browse the repository at this point in the history
Remove invalid argument from some calls to `makeMute`
  • Loading branch information
11k committed Jun 19, 2023
2 parents 4498a3f + 01488e2 commit 86a3c52
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion lib/commands/implementations/mute.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ function mute(input, services) {
parsedDuration,
`Muting: ${userToPunish} for ${formatDuration(moment.duration(parsedDuration, 'seconds'))}`,
),
true,
);
});
return new CommandOutput(null, null);
Expand Down
1 change: 0 additions & 1 deletion lib/commands/implementations/mutelinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ function mutelinks(defaultPunishmentDuration) {
muteDuration,
`${data.user} muted for ${formattedDuration} for posting a link while link muting is on.`,
),
true,
);
});
const displayState = state === 'all' ? 'on for all links' : state;
Expand Down
10 changes: 5 additions & 5 deletions lib/services/punishment-read-write-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ class PunishmentReadWriteStream extends Transform {
this.push(punished);
}

/**
* @param {Object} punished
* @param {boolean} punished.isBannedWord `true` if this mute was automatically issued as a result of the user typing a banned word
*/
handleMute(punished) {
getReporter().incrementCounter(METRIC_NAMES.MUTES_GIVEN, 1);
let muteDuration = null;
Expand Down Expand Up @@ -124,11 +128,7 @@ class PunishmentReadWriteStream extends Transform {
}

sendMute(reason, muteDuration, type, user) {
const clampedMutedDuration = _.clamp(
muteDuration,
0,
this.punishmentCache.maxMuteSeconds,
);
const clampedMutedDuration = _.clamp(muteDuration, 0, this.punishmentCache.maxMuteSeconds);
this.push({
user,
duration: clampedMutedDuration,
Expand Down

0 comments on commit 86a3c52

Please sign in to comment.