about summary refs log tree commit diff
path: root/src/lib/moderation/blocked-and-muted.ts
blob: 18e6ef3e347156f50ceaf30d7dc46b1ad63e1fba (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import {AppBskyActorDefs} from '@atproto/api'

export function isBlockedOrBlocking(
  profile:
    | AppBskyActorDefs.ProfileViewBasic
    | AppBskyActorDefs.ProfileViewDetailed,
) {
  return profile.viewer?.blockedBy || profile.viewer?.blocking
}

export function isMuted(
  profile:
    | AppBskyActorDefs.ProfileViewBasic
    | AppBskyActorDefs.ProfileViewDetailed,
) {
  return profile.viewer?.muted || profile.viewer?.mutedByList
}