summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/UserFollowingService.ts
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2024-09-28 09:55:21 +0900
committerGitHub <noreply@github.com>2024-09-28 09:55:21 +0900
commit28e9d4e483902771ddd20018f9e48b2cd0ea0673 (patch)
treee015d5ca2ed11b865078fffd7e66c8ffd38b4175 /packages/backend/src/core/UserFollowingService.ts
parent:art: (diff)
downloadsharkey-28e9d4e483902771ddd20018f9e48b2cd0ea0673.tar.gz
sharkey-28e9d4e483902771ddd20018f9e48b2cd0ea0673.tar.bz2
sharkey-28e9d4e483902771ddd20018f9e48b2cd0ea0673.zip
feat: フォローされた際のメッセージを設定できるようにする (#14430)
* feat: フォローされた際のメッセージを設定できるようにする Resolve #14425 * Update CHANGELOG.md * 既にフォローしているユーザーのメッセージも見れるように * Update packages/frontend/src/components/MkNotification.vue Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> * fix indent * Update users.ts * wip * Update users.ts --------- Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>
Diffstat (limited to 'packages/backend/src/core/UserFollowingService.ts')
-rw-r--r--packages/backend/src/core/UserFollowingService.ts15
1 files changed, 9 insertions, 6 deletions
diff --git a/packages/backend/src/core/UserFollowingService.ts b/packages/backend/src/core/UserFollowingService.ts
index 3f1c6b7125..77e7b60bea 100644
--- a/packages/backend/src/core/UserFollowingService.ts
+++ b/packages/backend/src/core/UserFollowingService.ts
@@ -275,16 +275,19 @@ export class UserFollowingService implements OnModuleInit {
followeeId: followee.id,
followerId: follower.id,
});
-
- // 通知を作成
- if (follower.host === null) {
- this.notificationService.createNotification(follower.id, 'followRequestAccepted', {
- }, followee.id);
- }
}
if (alreadyFollowed) return;
+ // 通知を作成
+ if (follower.host === null) {
+ const profile = await this.cacheService.userProfileCache.fetch(followee.id);
+
+ this.notificationService.createNotification(follower.id, 'followRequestAccepted', {
+ message: profile.followedMessage,
+ }, followee.id);
+ }
+
this.globalEventService.publishInternalEvent('follow', { followerId: follower.id, followeeId: followee.id });
const [followeeUser, followerUser] = await Promise.all([