diff options
-rw-r--r-- | src/components/PostControls/ShareMenu/RecentChats.tsx | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/components/PostControls/ShareMenu/RecentChats.tsx b/src/components/PostControls/ShareMenu/RecentChats.tsx index ca5d0029e..4b94e0df9 100644 --- a/src/components/PostControls/ShareMenu/RecentChats.tsx +++ b/src/components/PostControls/ShareMenu/RecentChats.tsx @@ -4,10 +4,12 @@ import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {useNavigation} from '@react-navigation/native' +import {isBlockedOrBlocking, isMuted} from '#/lib/moderation/blocked-and-muted' import {type NavigationProp} from '#/lib/routes/types' import {sanitizeDisplayName} from '#/lib/strings/display-names' import {sanitizeHandle} from '#/lib/strings/handles' import {logger} from '#/logger' +import {useProfileShadow} from '#/state/cache/profile-shadow' import {useModerationOpts} from '#/state/preferences/moderation-opts' import {useListConvosQuery} from '#/state/queries/messages/list-conversations' import {useSession} from '#/state/session' @@ -57,7 +59,11 @@ export function RecentChats({postUri}: {postUri: string}) { member => member.did !== currentAccount?.did, ) - if (!otherMember || otherMember.handle === 'missing.invalid') + if ( + !otherMember || + otherMember.handle === 'missing.invalid' || + convo.muted + ) return null return ( @@ -87,7 +93,7 @@ export function RecentChats({postUri}: {postUri: string}) { const WIDTH = 80 function RecentChatItem({ - profile, + profile: profileUnshadowed, onPress, moderationOpts, }: { @@ -98,6 +104,8 @@ function RecentChatItem({ const {_} = useLingui() const t = useTheme() + const profile = useProfileShadow(profileUnshadowed) + const moderation = moderateProfile(profile, moderationOpts) const name = sanitizeDisplayName( profile.displayName || sanitizeHandle(profile.handle), @@ -105,6 +113,10 @@ function RecentChatItem({ ) const verification = useSimpleVerificationState({profile}) + if (isBlockedOrBlocking(profile) || isMuted(profile)) { + return null + } + return ( <Button onPress={onPress} |