diff options
| author | zyoshoka <107108195+zyoshoka@users.noreply.github.com> | 2024-07-25 16:32:07 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-25 16:32:07 +0900 |
| commit | fc71bcc98e14f9c3c13ba74ade9245d64bd4b633 (patch) | |
| tree | 7d86ea64e1ec2878f25c09c2ce3d289e41c02df0 /packages/backend/src/core | |
| parent | fix(frontend): 初期化時とroute変更時でkeyの決定方法が違うの... (diff) | |
| download | sharkey-fc71bcc98e14f9c3c13ba74ade9245d64bd4b633.tar.gz sharkey-fc71bcc98e14f9c3c13ba74ade9245d64bd4b633.tar.bz2 sharkey-fc71bcc98e14f9c3c13ba74ade9245d64bd4b633.zip | |
fix(backend): avoid notifying to remote users on local (#13774)
* fix(backend): avoid notifying to remote users on local
* Update CHANGELOG.md
* refactor: check before calling method
---------
Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
Diffstat (limited to 'packages/backend/src/core')
| -rw-r--r-- | packages/backend/src/core/RoleService.ts | 5 | ||||
| -rw-r--r-- | packages/backend/src/core/UserFollowingService.ts | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/packages/backend/src/core/RoleService.ts b/packages/backend/src/core/RoleService.ts index 94026fd503..7966774673 100644 --- a/packages/backend/src/core/RoleService.ts +++ b/packages/backend/src/core/RoleService.ts @@ -505,14 +505,15 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit { this.globalEventService.publishInternalEvent('userRoleAssigned', created); - if (role.isPublic) { + const user = await this.usersRepository.findOneByOrFail({ id: userId }); + + if (role.isPublic && user.host === null) { this.notificationService.createNotification(userId, 'roleAssigned', { roleId: roleId, }); } if (moderator) { - const user = await this.usersRepository.findOneByOrFail({ id: userId }); this.moderationLogService.log(moderator, 'assignRole', { roleId: roleId, roleName: role.name, diff --git a/packages/backend/src/core/UserFollowingService.ts b/packages/backend/src/core/UserFollowingService.ts index 267a6a3f1b..6aab8fde70 100644 --- a/packages/backend/src/core/UserFollowingService.ts +++ b/packages/backend/src/core/UserFollowingService.ts @@ -279,8 +279,10 @@ export class UserFollowingService implements OnModuleInit { }); // 通知を作成 - this.notificationService.createNotification(follower.id, 'followRequestAccepted', { - }, followee.id); + if (follower.host === null) { + this.notificationService.createNotification(follower.id, 'followRequestAccepted', { + }, followee.id); + } } if (alreadyFollowed) return; |