summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/NotePiningService.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/backend/src/core/NotePiningService.ts')
-rw-r--r--packages/backend/src/core/NotePiningService.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/backend/src/core/NotePiningService.ts b/packages/backend/src/core/NotePiningService.ts
index f8997574a7..bc038e17a7 100644
--- a/packages/backend/src/core/NotePiningService.ts
+++ b/packages/backend/src/core/NotePiningService.ts
@@ -12,6 +12,7 @@ import { UserEntityService } from '@/core/entities/UserEntityService.js';
import { ApDeliverManagerService } from '@/core/activitypub/ApDeliverManagerService.js';
import { ApRendererService } from '@/core/activitypub/ApRendererService.js';
import { bindThis } from '@/decorators.js';
+import { RoleService } from '@/core/RoleService.js';
@Injectable()
export class NotePiningService {
@@ -30,6 +31,7 @@ export class NotePiningService {
private userEntityService: UserEntityService,
private idService: IdService,
+ private roleService: RoleService,
private relayService: RelayService,
private apDeliverManagerService: ApDeliverManagerService,
private apRendererService: ApRendererService,
@@ -55,7 +57,7 @@ export class NotePiningService {
const pinings = await this.userNotePiningsRepository.findBy({ userId: user.id });
- if (pinings.length >= 5) {
+ if (pinings.length >= (await this.roleService.getUserRoleOptions(user.id)).pinLimit) {
throw new IdentifiableError('15a018eb-58e5-4da1-93be-330fcc5e4e1a', 'You can not pin notes any more.');
}