misskey-dev / misskey

🌎 A completely free and open interplanetary microblogging platform 🚀
https://misskey-hub.net/
GNU Affero General Public License v3.0
9.95k stars 1.35k forks source link

feat: ユーザーの名前に禁止ワードを設定できるように #14756

Closed kakkokari-gtyih closed 4 hours ago

kakkokari-gtyih commented 1 day ago

What

Why

Fix #14751

Additional info (optional)

Checklist

syuilo commented 1 day ago

ユーザー名というよりユーザーの名前かしら

syuilo commented 1 day ago

既存の禁止ワードと別にする必要はあるかしら

github-actions[bot] commented 1 day ago

このPRによるapi.jsonの差分

差分はこちら ```diff --- base +++ head @@ -199,6 +199,12 @@ "type": "string" } }, + "prohibitedWordsForNameOfUser": { + "type": "array", + "items": { + "type": "string" + } + }, "bannedEmailDomains": { "type": "array", "items": { @@ -604,6 +610,7 @@ "blockedHosts", "sensitiveWords", "prohibitedWords", + "prohibitedWordsForNameOfUser", "preservedUsernames", "hcaptchaSecretKey", "mcaptchaSecretKey", @@ -13793,6 +13800,15 @@ "type": "string" } }, + "prohibitedWordsForNameOfUser": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, "themeColor": { "type": [ "string", @@ -51068,6 +51084,16 @@ } } }, + "YOUR_NAME_CONTAINS_PROHIBITED_WORDS": { + "value": { + "error": { + "message": "Your new name contains prohibited words.", + "code": "YOUR_NAME_CONTAINS_PROHIBITED_WORDS", + "id": "0b3f9f6a-2f4d-4b1f-9fb4-49d3a2fd7191", + "httpStatusCode": 422 + } + } + }, "INVALID_PARAM": { "value": { "error": { ``` [Get diff files from Workflow Page](https://github.com/misskey-dev/misskey/actions/runs/11313868245)
kakkokari-gtyih commented 1 day ago

ユーザー名というよりユーザーの名前かしら

なおした

既存の禁止ワードと別にする必要はあるかしら

ノートではCW等を利用して内容を隠せるのでユーザーの名前(常時表示される)ほど規制しなくてもいい等のケースが考えられるので分けられたほうが良さそう

codecov[bot] commented 1 day ago

Codecov Report

Attention: Patch coverage is 30.00000% with 63 lines in your changes missing coverage. Please review.

Project coverage is 41.38%. Comparing base (c4c69cd) to head (65cd41f). Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
packages/frontend/src/pages/admin/moderation.vue 0.00% 23 Missing :warning:
...kages/backend/src/server/api/endpoints/i/update.ts 42.85% 12 Missing :warning:
packages/frontend/src/pages/settings/profile.vue 0.00% 10 Missing :warning:
...ntend/src/components/MkUserSetupDialog.Profile.vue 0.00% 5 Missing :warning:
packages/frontend/src/os.ts 16.66% 5 Missing :warning:
packages/frontend/src/scripts/get-note-menu.ts 0.00% 4 Missing :warning:
...kend/src/server/api/endpoints/admin/update-meta.ts 62.50% 3 Missing :warning:
...ges/backend/src/server/api/endpoints/admin/meta.ts 87.50% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #14756 +/- ## =========================================== + Coverage 39.67% 41.38% +1.71% =========================================== Files 1554 1558 +4 Lines 195334 201176 +5842 Branches 3565 3653 +88 =========================================== + Hits 77501 83263 +5762 - Misses 117232 117312 +80 Partials 601 601 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

syuilo commented 1 day ago

ほむん

syuilo commented 5 hours ago

XだとscreenName=MisskeyのuserNameだからuserNameの方が良さそう

kakkokari-gtyih commented 4 hours ago

XだとscreenName=MisskeyのuserNameだからuserNameの方が良さそう

localeの話してる?(バックエンド系ならusername(@から始まるやつ)と混同する可能性があるので別のを検討したほうが良さそう)

syuilo commented 4 hours ago

全てだわね とはいえscreenNameも何のことだかわからなそう

kakkokari-gtyih commented 4 hours ago

とはいえscreenNameも何のことだかわからなそう

それはそう

syuilo commented 4 hours ago

少なくともscreenNameはMisskeyで言うところのusernameを指す言葉として使われることが多いから別のワードに変える必要がありそう

syuilo commented 4 hours ago

nameOfUserとかで良いんじゃないかしら

kakkokari-gtyih commented 4 hours ago

そうした

kakkokari-gtyih commented 4 hours ago

変なファイルが混入したかも

kakkokari-gtyih commented 4 hours ago

変なファイルが混入したかも

消せたかも

syuilo commented 4 hours ago

👍🏻