Skip to content

Commit 86a3c52

Browse files
authored
Merge pull request #137 from destinygg/banned-word
Remove invalid argument from some calls to `makeMute`
2 parents 4498a3f + 01488e2 commit 86a3c52

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

lib/commands/implementations/mute.js

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ function mute(input, services) {
2222
parsedDuration,
2323
`Muting: ${userToPunish} for ${formatDuration(moment.duration(parsedDuration, 'seconds'))}`,
2424
),
25-
true,
2625
);
2726
});
2827
return new CommandOutput(null, null);

lib/commands/implementations/mutelinks.js

-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ function mutelinks(defaultPunishmentDuration) {
6363
muteDuration,
6464
`${data.user} muted for ${formattedDuration} for posting a link while link muting is on.`,
6565
),
66-
true,
6766
);
6867
});
6968
const displayState = state === 'all' ? 'on for all links' : state;

lib/services/punishment-read-write-stream.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ class PunishmentReadWriteStream extends Transform {
9393
this.push(punished);
9494
}
9595

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

126130
sendMute(reason, muteDuration, type, user) {
127-
const clampedMutedDuration = _.clamp(
128-
muteDuration,
129-
0,
130-
this.punishmentCache.maxMuteSeconds,
131-
);
131+
const clampedMutedDuration = _.clamp(muteDuration, 0, this.punishmentCache.maxMuteSeconds);
132132
this.push({
133133
user,
134134
duration: clampedMutedDuration,

0 commit comments

Comments
 (0)