feat: 指定したユーザーの投稿通知

Resolve #11499
This commit is contained in:
syuilo 2023-09-21 18:48:15 +09:00
parent f195fa4ab9
commit e3f151e230
25 changed files with 238 additions and 31 deletions

View file

@ -146,15 +146,14 @@ export class UserEntityService implements OnModuleInit {
@bindThis
public async getRelation(me: MiUser['id'], target: MiUser['id']) {
const following = await this.followingsRepository.findOneBy({
followerId: me,
followeeId: target,
});
return awaitAll({
id: target,
isFollowing: this.followingsRepository.count({
where: {
followerId: me,
followeeId: target,
},
take: 1,
}).then(n => n > 0),
following,
isFollowing: following != null,
isFollowed: this.followingsRepository.count({
where: {
followerId: target,
@ -486,6 +485,7 @@ export class UserEntityService implements OnModuleInit {
isBlocked: relation.isBlocked,
isMuted: relation.isMuted,
isRenoteMuted: relation.isRenoteMuted,
notify: relation.following?.notify ?? 'none',
} : {}),
} as Promiseable<Packed<'User'>> as Promiseable<IsMeAndIsUserDetailed<ExpectsMe, D>>;