Skip to content
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

Open
wants to merge 8 commits into
base: io
Choose a base branch
from

Conversation

mattyatea
Copy link
Member

What

Why

Additional info (optional)

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

Copy link

snyk-io bot commented Feb 4, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

@mattyatea mattyatea marked this pull request as ready for review February 15, 2025 12:11
@mattyatea mattyatea requested a review from u1-liquid February 15, 2025 12:11
@mattyatea mattyatea changed the title WIP: Enhance(sensitive-flag):センシティブフラグの機能の強化 Enhance(sensitive-flag):センシティブフラグの機能の強化 Feb 17, 2025
@@ -1334,6 +1334,8 @@ scheduled: "予約済み"
unschedule: "予約を解除"
setScheduledTime: "予約日時を設定"
willBePostedAt: "{x}に投稿されます"
sensitiveByModerator: "管理者によって、ドライブのファイルがセンシティブとして設定されました。\n詳細については[NSFWガイドライン](https://go.misskey.io/media-guideline)を確認してください"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1行目に句点が付いているので2行目にも付けた方が違和感がないと思う

Comment on lines 99 to 101
if (!await this.roleService.isModerator(me) && file.isSensitiveByModerator) {
throw new ApiError(meta.errors.restrictedByModerator);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ロールでの処理が updateFile の中にあるので、それに合わせてそっちに移動したほうが良いかも

Comment on lines +687 to +689
if (isModerator && file.userId !== updater.id) {
values.isSensitiveByModerator = values.isSensitive;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

モデレータがアップロードしたファイルを、別のモデレータがセンシティブに設定し、その後本人がセンシティブを解除した場合、おかしな状態になると思う
(操作ミスなどで起こりうるが、あんまり気にしなくて良いとは思う)

@mattyatea mattyatea removed the request for review from u1-liquid February 22, 2025 14:03

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) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

括弧の位置間違ってると思う
多分これだとモデレーターからセンシティブにされた場合にファイル名とか全部いじれなくなる

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants