enhance(word-mute): ワードミュートの制限を文字数から設定項目数に (MisskeyIO#242)

This commit is contained in:
まっちゃとーにゅ
2023-11-21 03:11:14 +09:00
committed by GitHub
parent 61592a3fb2
commit d2b2beef80
3 changed files with 4 additions and 5 deletions

View File

@@ -236,8 +236,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
if (ps.birthday !== undefined) profileUpdates.birthday = ps.birthday;
if (ps.ffVisibility !== undefined) profileUpdates.ffVisibility = ps.ffVisibility;
if (ps.mutedWords !== undefined) {
// TODO: ちゃんと数える
const length = JSON.stringify(ps.mutedWords).length;
const length = ps.mutedWords.length;
if (length > (await this.roleService.getUserPolicies(user.id)).wordMuteLimit) {
throw new ApiError(meta.errors.tooManyMutedWords);
}