]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/account/account-blocklist.ts
Add import finished and video published notifs
[github/Chocobozzz/PeerTube.git] / server / models / account / account-blocklist.ts
index fa281923547be9764d1395d474a25c0b13fe9666..54ac290c4b69eb13873a9bf8e86d1864afde604b 100644 (file)
@@ -72,6 +72,21 @@ export class AccountBlocklistModel extends Model<AccountBlocklistModel> {
   })
   BlockedAccount: AccountModel
 
+  static isAccountMutedBy (accountId: number, targetAccountId: number) {
+    const query = {
+      attributes: [ 'id' ],
+      where: {
+        accountId,
+        targetAccountId
+      },
+      raw: true
+    }
+
+    return AccountBlocklistModel.unscoped()
+                                .findOne(query)
+                                .then(a => !!a)
+  }
+
   static loadByAccountAndTarget (accountId: number, targetAccountId: number) {
     const query = {
       where: {