add: isSilenced handling to user and timeline

This commit is contained in:
Mar0xy 2023-10-18 13:34:16 +02:00
parent 95b2689a21
commit a4a1b8bb8b
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828
19 changed files with 171 additions and 11 deletions

View file

@ -368,6 +368,7 @@ export class UserEntityService implements OnModuleInit {
createdAt: this.idService.parse(user.id).date.toISOString(),
isBot: user.isBot ?? falsy,
isCat: user.isCat ?? falsy,
isSilenced: user.isSilenced || this.roleService.getUserPolicies(user.id).then(r => !r.canPublicNote),
speakAsCat: user.speakAsCat ?? falsy,
instance: user.host ? this.federatedInstanceService.federatedInstanceCache.fetch(user.host).then(instance => instance ? {
name: instance.name,
@ -404,7 +405,6 @@ export class UserEntityService implements OnModuleInit {
backgroundUrl: user.backgroundUrl,
backgroundBlurhash: user.backgroundBlurhash,
isLocked: user.isLocked,
isSilenced: this.roleService.getUserPolicies(user.id).then(r => !r.canPublicNote),
isSuspended: user.isSuspended ?? falsy,
location: profile!.location,
birthday: profile!.birthday,