mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-06 12:06:58 +00:00
merge: Add "is from local bubble instance" role condition (!1011)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1011 Approved-by: dakkar <dakkar@thenautilus.net> Approved-by: Marie <github@yuugi.dev>
This commit is contained in:
commit
00cfeca3d7
5 changed files with 18 additions and 0 deletions
4
locales/index.d.ts
vendored
4
locales/index.d.ts
vendored
|
@ -7689,6 +7689,10 @@ export interface Locale extends ILocale {
|
|||
* Match subdomains
|
||||
*/
|
||||
"isFromInstanceSubdomains": string;
|
||||
/**
|
||||
* User is from a bubble instance
|
||||
*/
|
||||
"fromBubbleInstance": string;
|
||||
/**
|
||||
* Has X or fewer local followers
|
||||
*/
|
||||
|
|
|
@ -262,6 +262,10 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit {
|
|||
return user.host.toLowerCase() === value.host.toLowerCase();
|
||||
}
|
||||
}
|
||||
// Is the user from a local bubble instance
|
||||
case 'fromBubbleInstance': {
|
||||
return user.host != null && this.meta.bubbleInstances.includes(user.host);
|
||||
}
|
||||
// サスペンド済みユーザである
|
||||
case 'isSuspended': {
|
||||
return user.isSuspended;
|
||||
|
|
|
@ -56,6 +56,13 @@ type CondFormulaValueIsFromInstance = {
|
|||
subdomains: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* Is the user from a local bubble instance
|
||||
*/
|
||||
type CondFormulaValueFromBubbleInstance = {
|
||||
type: 'fromBubbleInstance';
|
||||
};
|
||||
|
||||
/**
|
||||
* 既に指定のマニュアルロールにアサインされている場合のみ成立とする
|
||||
*/
|
||||
|
@ -234,6 +241,7 @@ export type RoleCondFormulaValue = { id: string } & (
|
|||
CondFormulaValueIsLocal |
|
||||
CondFormulaValueIsRemote |
|
||||
CondFormulaValueIsFromInstance |
|
||||
CondFormulaValueFromBubbleInstance |
|
||||
CondFormulaValueIsSuspended |
|
||||
CondFormulaValueIsLocked |
|
||||
CondFormulaValueIsBot |
|
||||
|
|
|
@ -10,6 +10,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<option value="isLocal">{{ i18n.ts._role._condition.isLocal }}</option>
|
||||
<option value="isRemote">{{ i18n.ts._role._condition.isRemote }}</option>
|
||||
<option value="isFromInstance">{{ i18n.ts._role._condition.isFromInstance }}</option>
|
||||
<option value="fromBubbleInstance">{{ i18n.ts._role._condition.fromBubbleInstance }}</option>
|
||||
<option value="isSuspended">{{ i18n.ts._role._condition.isSuspended }}</option>
|
||||
<option value="isLocked">{{ i18n.ts._role._condition.isLocked }}</option>
|
||||
<option value="isBot">{{ i18n.ts._role._condition.isBot }}</option>
|
||||
|
|
|
@ -245,6 +245,7 @@ _role:
|
|||
isFromInstance: "Is from a specific instance"
|
||||
isFromInstanceHost: "Hostname (case-insensitive)"
|
||||
isFromInstanceSubdomains: "Match subdomains"
|
||||
fromBubbleInstance: "User is from a bubble instance"
|
||||
localFollowersLessThanOrEq: "Has X or fewer local followers"
|
||||
localFollowersMoreThanOrEq: "Has X or more local followers"
|
||||
localFollowingLessThanOrEq: "Follows X or fewer local accounts"
|
||||
|
|
Loading…
Add table
Reference in a new issue