diff options
Diffstat (limited to 'server/models/account/account-blocklist.ts')
-rw-r--r-- | server/models/account/account-blocklist.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/server/models/account/account-blocklist.ts b/server/models/account/account-blocklist.ts index fa2819235..54ac290c4 100644 --- a/server/models/account/account-blocklist.ts +++ b/server/models/account/account-blocklist.ts | |||
@@ -72,6 +72,21 @@ export class AccountBlocklistModel extends Model<AccountBlocklistModel> { | |||
72 | }) | 72 | }) |
73 | BlockedAccount: AccountModel | 73 | BlockedAccount: AccountModel |
74 | 74 | ||
75 | static isAccountMutedBy (accountId: number, targetAccountId: number) { | ||
76 | const query = { | ||
77 | attributes: [ 'id' ], | ||
78 | where: { | ||
79 | accountId, | ||
80 | targetAccountId | ||
81 | }, | ||
82 | raw: true | ||
83 | } | ||
84 | |||
85 | return AccountBlocklistModel.unscoped() | ||
86 | .findOne(query) | ||
87 | .then(a => !!a) | ||
88 | } | ||
89 | |||
75 | static loadByAccountAndTarget (accountId: number, targetAccountId: number) { | 90 | static loadByAccountAndTarget (accountId: number, targetAccountId: number) { |
76 | const query = { | 91 | const query = { |
77 | where: { | 92 | where: { |