mirror of
https://git.boykissers.com/pawkey/pawkey-sk.git
synced 2025-12-20 12:14:18 +00:00
add "is from local bubble instance" role condition
This commit is contained in:
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 local 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 local bubble instance"
|
||||
localFollowersLessThanOrEq: "Has X or fewer local followers"
|
||||
localFollowersMoreThanOrEq: "Has X or more local followers"
|
||||
localFollowingLessThanOrEq: "Follows X or fewer local accounts"
|
||||
|
||||
Reference in New Issue
Block a user