-
Notifications
You must be signed in to change notification settings - Fork 15
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
Enhance(sensitive-flag):センシティブフラグの機能の強化 #936
base: io
Are you sure you want to change the base?
Conversation
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) |
@@ -1334,6 +1334,8 @@ scheduled: "予約済み" | |||
unschedule: "予約を解除" | |||
setScheduledTime: "予約日時を設定" | |||
willBePostedAt: "{x}に投稿されます" | |||
sensitiveByModerator: "管理者によって、ドライブのファイルがセンシティブとして設定されました。\n詳細については[NSFWガイドライン](https://go.misskey.io/media-guideline)を確認してください" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1行目に句点が付いているので2行目にも付けた方が違和感がないと思う
if (!await this.roleService.isModerator(me) && file.isSensitiveByModerator) { | ||
throw new ApiError(meta.errors.restrictedByModerator); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ロールでの処理が updateFile の中にあるので、それに合わせてそっちに移動したほうが良いかも
if (isModerator && file.userId !== updater.id) { | ||
values.isSensitiveByModerator = values.isSensitive; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
モデレータがアップロードしたファイルを、別のモデレータがセンシティブに設定し、その後本人がセンシティブを解除した場合、おかしな状態になると思う
(操作ミスなどで起こりうるが、あんまり気にしなくて良いとは思う)
|
|
||
if (values.name != null && !this.driveFileEntityService.validateFileName(values.name)) { | ||
throw new DriveService.InvalidFileNameError(); | ||
} | ||
|
||
if (values.isSensitive !== undefined && values.isSensitive !== file.isSensitive && alwaysMarkNsfw && !values.isSensitive) { | ||
if ((values.isSensitive !== undefined && values.isSensitive !== file.isSensitive && alwaysMarkNsfw || (!isModerator && file.isSensitiveByModerator)) && !values.isSensitive) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
括弧の位置間違ってると思う
多分これだとモデレーターからセンシティブにされた場合にファイル名とか全部いじれなくなる
What
Why
Additional info (optional)
Checklist