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

@ -58,7 +58,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
}
const isModerator = await this.roleService.isModerator(user);
const isSilenced = !(await this.roleService.getUserPolicies(user.id)).canPublicNote;
const isSilenced = user.isSilenced || !(await this.roleService.getUserPolicies(user.id)).canPublicNote;
const _me = await this.usersRepository.findOneByOrFail({ id: me.id });
if (!await this.roleService.isAdministrator(_me) && await this.roleService.isAdministrator(user)) {