+async function isBlockedByServerOrAccount (targetAccount: MAccountServer, userAccount?: MAccountId) {
+ const serverAccountId = (await getServerActor()).Account.id
+ const sourceAccounts = [ serverAccountId ]
+
+ if (userAccount) sourceAccounts.push(userAccount.id)
+
+ const accountMutedHash = await AccountBlocklistModel.isAccountMutedByAccounts(sourceAccounts, targetAccount.id)
+ if (accountMutedHash[serverAccountId] || (userAccount && accountMutedHash[userAccount.id])) {
+ return true
+ }
+
+ const instanceMutedHash = await ServerBlocklistModel.isServerMutedByAccounts(sourceAccounts, targetAccount.Actor.serverId)
+ if (instanceMutedHash[serverAccountId] || (userAccount && instanceMutedHash[userAccount.id])) {
+ return true
+ }
+
+ return false
+}
+