mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 12:36:57 +00:00
add "is from local bubble instance" role condition
This commit is contained in:
parent
cace4153e4
commit
655290f8a4
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
|
* Match subdomains
|
||||||
*/
|
*/
|
||||||
"isFromInstanceSubdomains": string;
|
"isFromInstanceSubdomains": string;
|
||||||
|
/**
|
||||||
|
* User is from a local bubble instance
|
||||||
|
*/
|
||||||
|
"fromBubbleInstance": string;
|
||||||
/**
|
/**
|
||||||
* Has X or fewer local followers
|
* Has X or fewer local followers
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -262,6 +262,10 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit {
|
||||||
return user.host.toLowerCase() === value.host.toLowerCase();
|
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': {
|
case 'isSuspended': {
|
||||||
return user.isSuspended;
|
return user.isSuspended;
|
||||||
|
|
|
@ -56,6 +56,13 @@ type CondFormulaValueIsFromInstance = {
|
||||||
subdomains: boolean;
|
subdomains: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is the user from a local bubble instance
|
||||||
|
*/
|
||||||
|
type CondFormulaValueFromBubbleInstance = {
|
||||||
|
type: 'fromBubbleInstance';
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 既に指定のマニュアルロールにアサインされている場合のみ成立とする
|
* 既に指定のマニュアルロールにアサインされている場合のみ成立とする
|
||||||
*/
|
*/
|
||||||
|
@ -234,6 +241,7 @@ export type RoleCondFormulaValue = { id: string } & (
|
||||||
CondFormulaValueIsLocal |
|
CondFormulaValueIsLocal |
|
||||||
CondFormulaValueIsRemote |
|
CondFormulaValueIsRemote |
|
||||||
CondFormulaValueIsFromInstance |
|
CondFormulaValueIsFromInstance |
|
||||||
|
CondFormulaValueFromBubbleInstance |
|
||||||
CondFormulaValueIsSuspended |
|
CondFormulaValueIsSuspended |
|
||||||
CondFormulaValueIsLocked |
|
CondFormulaValueIsLocked |
|
||||||
CondFormulaValueIsBot |
|
CondFormulaValueIsBot |
|
||||||
|
|
|
@ -10,6 +10,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<option value="isLocal">{{ i18n.ts._role._condition.isLocal }}</option>
|
<option value="isLocal">{{ i18n.ts._role._condition.isLocal }}</option>
|
||||||
<option value="isRemote">{{ i18n.ts._role._condition.isRemote }}</option>
|
<option value="isRemote">{{ i18n.ts._role._condition.isRemote }}</option>
|
||||||
<option value="isFromInstance">{{ i18n.ts._role._condition.isFromInstance }}</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="isSuspended">{{ i18n.ts._role._condition.isSuspended }}</option>
|
||||||
<option value="isLocked">{{ i18n.ts._role._condition.isLocked }}</option>
|
<option value="isLocked">{{ i18n.ts._role._condition.isLocked }}</option>
|
||||||
<option value="isBot">{{ i18n.ts._role._condition.isBot }}</option>
|
<option value="isBot">{{ i18n.ts._role._condition.isBot }}</option>
|
||||||
|
|
|
@ -245,6 +245,7 @@ _role:
|
||||||
isFromInstance: "Is from a specific instance"
|
isFromInstance: "Is from a specific instance"
|
||||||
isFromInstanceHost: "Hostname (case-insensitive)"
|
isFromInstanceHost: "Hostname (case-insensitive)"
|
||||||
isFromInstanceSubdomains: "Match subdomains"
|
isFromInstanceSubdomains: "Match subdomains"
|
||||||
|
fromBubbleInstance: "User is from a local bubble instance"
|
||||||
localFollowersLessThanOrEq: "Has X or fewer local followers"
|
localFollowersLessThanOrEq: "Has X or fewer local followers"
|
||||||
localFollowersMoreThanOrEq: "Has X or more local followers"
|
localFollowersMoreThanOrEq: "Has X or more local followers"
|
||||||
localFollowingLessThanOrEq: "Follows X or fewer local accounts"
|
localFollowingLessThanOrEq: "Follows X or fewer local accounts"
|
||||||
|
|
Loading…
Add table
Reference in a new issue