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

feat: デフォルトでフォローするユーザーを指定できるように #14769

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

kakkokari-gtyih
Copy link
Contributor

@kakkokari-gtyih kakkokari-gtyih commented Oct 15, 2024

What

  • アカウント作成時に自動でフォローしておく(後でユーザー自身で解除可能)ユーザーを指定できるように
  • アカウント作成時に自動でフォローしておく(ユーザーがフォロー解除・ミュート・ブロックすることはできない)ユーザーを指定できるように

Why

Fix #12451

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

@github-actions github-actions bot added packages/frontend Client side specific issue/PR packages/backend Server side specific issue/PR packages/misskey-js labels Oct 15, 2024
Copy link
Contributor

github-actions bot commented Oct 15, 2024

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

差分はこちら
--- base
+++ head
@@ -175,6 +175,18 @@
                         "type": "string"
                       }
                     },
+                    "defaultFollowedUsers": {
+                      "type": "array",
+                      "items": {
+                        "type": "string"
+                      }
+                    },
+                    "forciblyFollowedUsers": {
+                      "type": "array",
+                      "items": {
+                        "type": "string"
+                      }
+                    },
                     "hiddenTags": {
                       "type": "array",
                       "items": {
@@ -609,6 +621,8 @@
                     "translatorAvailable",
                     "mediaSilencedHosts",
                     "pinnedUsers",
+                    "defaultFollowedUsers",
+                    "forciblyFollowedUsers",
                     "hiddenTags",
                     "blockedHosts",
                     "sensitiveWords",
@@ -13768,6 +13782,26 @@
                       "type": "string"
                     }
                   },
+                  "defaultFollowedUsers": {
+                    "type": [
+                      "array",
+                      "null"
+                    ],
+                    "items": {
+                      "type": "string",
+                      "format": "misskey:id"
+                    }
+                  },
+                  "forciblyFollowedUsers": {
+                    "type": [
+                      "array",
+                      "null"
+                    ],
+                    "items": {
+                      "type": "string",
+                      "format": "misskey:id"
+                    }
+                  },
                   "hiddenTags": {
                     "type": [
                       "array",
@@ -14367,6 +14401,15 @@
                   "$ref": "#/components/schemas/Error"
                 },
                 "examples": {
+                  "FOLLOWED_USER_DUPLICATED": {
+                    "value": {
+                      "error": {
+                        "message": "Some items in \"defaultFollowedUsers\" and \"forciblyFollowedUsers\" are duplicated.",
+                        "code": "FOLLOWED_USER_DUPLICATED",
+                        "id": "bcf088ec-fec5-42d0-8b9e-16d3b4797a4d"
+                      }
+                    }
+                  },
                   "INVALID_PARAM": {
                     "value": {
                       "error": {
@@ -20412,6 +20455,16 @@
                       }
                     }
                   },
+                  "CANNOT_BLOCK_DUE_TO_SERVER_POLICY": {
+                    "value": {
+                      "error": {
+                        "message": "You cannot block that user due to server policy.",
+                        "code": "CANNOT_BLOCK_DUE_TO_SERVER_POLICY",
+                        "id": "e2f04d25-0d94-4ac3-a4d8-ba401062741b",
+                        "httpStatusCode": 403
+                      }
+                    }
+                  },
                   "INVALID_PARAM": {
                     "value": {
                       "error": {
@@ -36717,6 +36770,16 @@
                       }
                     }
                   },
+                  "CANNOT_UNFOLLOW_DUE_TO_SERVER_POLICY": {
+                    "value": {
+                      "error": {
+                        "message": "You cannot unfollow that user due to server policy.",
+                        "code": "CANNOT_UNFOLLOW_DUE_TO_SERVER_POLICY",
+                        "id": "19f25f61-0141-4683-99dc-217a88d633cb",
+                        "httpStatusCode": 403
+                      }
+                    }
+                  },
                   "INVALID_PARAM": {
                     "value": {
                       "error": {
@@ -54331,6 +54394,16 @@
                       }
                     }
                   },
+                  "CANNOT_MUTE_DUE_TO_SERVER_POLICY": {
+                    "value": {
+                      "error": {
+                        "message": "You cannot mute that user due to server policy.",
+                        "code": "CANNOT_MUTE_DUE_TO_SERVER_POLICY",
+                        "id": "15273a89-374d-49fa-8df6-8bb3feeea455",
+                        "httpStatusCode": 403
+                      }
+                    }
+                  },
                   "INVALID_PARAM": {
                     "value": {
                       "error": {
@@ -54868,6 +54941,16 @@
                       }
                     }
                   },
+                  "CANNOT_MUTE_DUE_TO_SERVER_POLICY": {
+                    "value": {
+                      "error": {
+                        "message": "You cannot mute that user due to server policy.",
+                        "code": "CANNOT_MUTE_DUE_TO_SERVER_POLICY",
+                        "id": "15273a89-374d-49fa-8df6-8bb3feeea455",
+                        "httpStatusCode": 403
+                      }
+                    }
+                  },
                   "INVALID_PARAM": {
                     "value": {
                       "error": {

Get diff files from Workflow Page

Copy link

codecov bot commented Oct 15, 2024

Codecov Report

Attention: Patch coverage is 43.59862% with 163 lines in your changes missing coverage. Please review.

Project coverage is 41.37%. Comparing base (a3d236c) to head (b3fc288).
Report is 329 commits behind head on develop.

Files with missing lines Patch % Lines
packages/frontend/src/pages/admin/moderation.vue 0.00% 34 Missing ⚠️
...kend/src/server/api/endpoints/admin/update-meta.ts 54.76% 19 Missing ⚠️
packages/backend/src/core/SignupService.ts 10.52% 17 Missing ⚠️
packages/frontend/src/scripts/get-user-menu.ts 0.00% 15 Missing ⚠️
...c/queue/processors/RelationshipProcessorService.ts 20.00% 12 Missing ⚠️
packages/backend/src/core/UserMutingService.ts 43.75% 9 Missing ⚠️
...ckages/backend/src/core/UserRenoteMutingService.ts 43.75% 9 Missing ⚠️
...ackend/src/server/api/endpoints/blocking/create.ts 50.00% 8 Missing ⚠️
...ackages/frontend/src/components/MkFollowButton.vue 0.00% 8 Missing ⚠️
...c/queue/processors/ImportMutingProcessorService.ts 12.50% 7 Missing ⚠️
... and 6 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #14769      +/-   ##
===========================================
- Coverage    41.74%   41.37%   -0.38%     
===========================================
  Files         1549     1558       +9     
  Lines       196555   201779    +5224     
  Branches      2767     2592     -175     
===========================================
+ Hits         82055    83477    +1422     
- Misses      113939   117734    +3795     
- Partials       561      568       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@samunohito
Copy link
Member

/preview

@kakkokari-gtyih
Copy link
Contributor Author

フォロー解除できないユーザーのほうのプロパティ名が微妙なので募集中

@anatawa12
Copy link
Member

anatawa12 commented Oct 18, 2024

permanentFollowedはpermientが形容詞だけどfollowedは名詞じゃないので品詞的におかしくてpermanentlyのほうが適切だとは思います。そもそも単語選択レベルでもっといいのあるかもだけど
(個人的には permanently followed users があんまり悪く感じてない)

@syuilo
Copy link
Member

syuilo commented Oct 18, 2024

forceとか

@syuilo
Copy link
Member

syuilo commented Oct 18, 2024

fixedとか

@kakkokari-gtyih
Copy link
Contributor Author

kakkokari-gtyih commented Oct 18, 2024

permanentlyのほうが適切だとは思います。

forceとか

の両方を取り入れて forciblyFollowedUsers でいくか

@kakkokari-gtyih
Copy link
Contributor Author

permanentlyのほうが適切だとは思います。

forceとか

の両方を取り入れて forciblyFollowedUsers でいくか

そうした

@kakkokari-gtyih kakkokari-gtyih marked this pull request as ready for review October 18, 2024 07:53
@kakkokari-gtyih
Copy link
Contributor Author

kakkokari-gtyih commented Oct 18, 2024

ピン留めユーザーの設定はacct形式での入力を求めるのに対して、(処理を簡略化する都合上)こちらではユーザーIDを入力させるようにしてあるけど、改めたほうがいいかしら(管理者画面なので「IDを入力せよ」と明記するだけで良い説はある (すでにそれはやってある))

@syuilo
Copy link
Member

syuilo commented Oct 18, 2024

アカウント作成時に自動でフォローしておく(ユーザーがフォロー解除・ミュート・ブロックすることはできない)ユーザーを指定できるように

これユーザーにとって不便になる影響の方が大きいんじゃないかしら
「フォロー」は現状「タイムラインにそのユーザーの投稿を表示する」以上の意味を持っているから、サジェストで優先的に表示されるようになったりがあるけど、お知らせアカウントなどがサジェストに出てきても邪魔になりそう

@kakkokari-gtyih
Copy link
Contributor Author

kakkokari-gtyih commented Oct 18, 2024

デフォルトでフォローしてるし、さらにフォロー解除できないオプションとかあっても良さそう(実際規約でそのように運用しているサーバーはある)
#12451 (comment)

だからサーバーの運用に合わせて管理者がうまいこと使い分ければ良さそう(ユーザーでフォロー解除できる方も別個の設定として存在しているので)

@syuilo
Copy link
Member

syuilo commented Oct 18, 2024

ほむん

@kakkokari-gtyih
Copy link
Contributor Author

kakkokari-gtyih commented Oct 18, 2024

デフォルトでフォローしてるし、さらにフォロー解除できないオプションとかあっても良さそう(実際規約でそのように運用しているサーバーはある)
#12451 (comment)

だからサーバーの運用に合わせて管理者がうまいこと使い分ければ良さそう(ユーザーでフォロー解除できる方も別個の設定として存在しているので)

お知らせ管理画面周りみたく、別途MkInfoか何かで「フォロー解除できない方の設定は最低限のアカウントにすることをおすすめします」とかを書くといいのかもしれない

@syuilo
Copy link
Member

syuilo commented Oct 18, 2024

インポート機能使えばミュートやブロック不可制限を回避できそうな予感

@kakkokari-gtyih
Copy link
Contributor Author

インポート機能使えばミュートやブロック不可制限を回避できそうな予感

あーそっちは塞いでなかったわね
塞ぐか

@kakkokari-gtyih
Copy link
Contributor Author

kakkokari-gtyih commented Oct 18, 2024

ピン留めユーザーの設定はacct形式での入力を求めるのに対して、(処理を簡略化する都合上)こちらではユーザーIDを入力させるようにしてあるけど、改めたほうがいいかしら(管理者画面なので「IDを入力せよ」と明記するだけで良い説はある (すでにそれはやってある))
#14769 (comment)

これどうだろう

@kakkokari-gtyih
Copy link
Contributor Author

インポート機能使えばミュートやブロック不可制限を回避できそうな予感

あーそっちは塞いでなかったわね 塞ぐか

塞いだ

@syuilo
Copy link
Member

syuilo commented Oct 18, 2024

UserMutingService.muteとかに当該ロジックあった方が自然だし漏れが無くなるけどそうしなかった理由はあるかしら

@kakkokari-gtyih
Copy link
Contributor Author

kakkokari-gtyih commented Oct 18, 2024

UserMutingService.muteとかに当該ロジックあった方が自然だし漏れが無くなるけどそうしなかった理由はあるかしら

あーそっちに入れるほうがいいか(別の内部的な処理とかち合うとややこしそうかなと思ったので)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages/backend Server side specific issue/PR packages/frontend Client side specific issue/PR packages/misskey-js
Projects
None yet
Development

Successfully merging this pull request may close these issues.

デフォルトで特定のユーザーをフォローする
4 participants