diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8f32284f9b..976db8a6f4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,7 +15,7 @@
## 13.x.x (unreleased)
### General
--
+- コンディショナルロールの条件に「投稿数が~以下」「投稿数が~以上」を追加
### Client
- センシティブワードの一覧にピン留めユーザーのIDが表示される問題を修正
diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml
index 2011ca3636..36d4a4f2f2 100644
--- a/locales/ja-JP.yml
+++ b/locales/ja-JP.yml
@@ -1279,6 +1279,8 @@ _role:
followersMoreThanOrEq: "フォロワー数が~以上"
followingLessThanOrEq: "フォロー数が~以下"
followingMoreThanOrEq: "フォロー数が~以上"
+ notesLessThanOrEq: "投稿数が~以下"
+ notesMoreThanOrEq: "投稿数が~以上"
and: "~かつ~"
or: "~または~"
not: "~ではない"
@@ -1929,4 +1931,4 @@ _disabledTimeline:
_drivecleaner:
orderBySizeDesc: "サイズが大きい順"
- orderByCreatedAtAsc: "追加日が古い順"
\ No newline at end of file
+ orderByCreatedAtAsc: "追加日が古い順"
diff --git a/packages/backend/src/core/RoleService.ts b/packages/backend/src/core/RoleService.ts
index 4775196c6f..bb7680f4e5 100644
--- a/packages/backend/src/core/RoleService.ts
+++ b/packages/backend/src/core/RoleService.ts
@@ -192,6 +192,12 @@ export class RoleService implements OnApplicationShutdown {
case 'followingMoreThanOrEq': {
return user.followingCount >= value.value;
}
+ case 'notesLessThanOrEq': {
+ return user.notesCount <= value.value;
+ }
+ case 'notesMoreThanOrEq': {
+ return user.notesCount >= value.value;
+ }
default:
return false;
}
diff --git a/packages/backend/src/models/entities/Role.ts b/packages/backend/src/models/entities/Role.ts
index 85ff266740..eca9bcf270 100644
--- a/packages/backend/src/models/entities/Role.ts
+++ b/packages/backend/src/models/entities/Role.ts
@@ -54,6 +54,16 @@ type CondFormulaValueFollowingMoreThanOrEq = {
value: number;
};
+type CondFormulaValueNotesLessThanOrEq = {
+ type: 'notesLessThanOrEq';
+ value: number;
+};
+
+type CondFormulaValueNotesMoreThanOrEq = {
+ type: 'notesMoreThanOrEq';
+ value: number;
+};
+
export type RoleCondFormulaValue =
CondFormulaValueAnd |
CondFormulaValueOr |
@@ -65,7 +75,9 @@ export type RoleCondFormulaValue =
CondFormulaValueFollowersLessThanOrEq |
CondFormulaValueFollowersMoreThanOrEq |
CondFormulaValueFollowingLessThanOrEq |
- CondFormulaValueFollowingMoreThanOrEq;
+ CondFormulaValueFollowingMoreThanOrEq |
+ CondFormulaValueNotesLessThanOrEq |
+ CondFormulaValueNotesMoreThanOrEq;
@Entity()
export class Role {
diff --git a/packages/frontend/src/pages/admin/RolesEditorFormula.vue b/packages/frontend/src/pages/admin/RolesEditorFormula.vue
index 07729b8cf9..343d2c4c5c 100644
--- a/packages/frontend/src/pages/admin/RolesEditorFormula.vue
+++ b/packages/frontend/src/pages/admin/RolesEditorFormula.vue
@@ -10,6 +10,8 @@
+
+
@@ -42,7 +44,7 @@
sec
-
+
@@ -91,6 +93,8 @@ const type = computed({
if (t === 'followersMoreThanOrEq') v.value.value = 10;
if (t === 'followingLessThanOrEq') v.value.value = 10;
if (t === 'followingMoreThanOrEq') v.value.value = 10;
+ if (t === 'notesLessThanOrEq') v.value.value = 10;
+ if (t === 'notesMoreThanOrEq') v.value.value = 10;
v.value.type = t;
},
});