diff options
author | Samuel Newman <mozzius@protonmail.com> | 2025-08-12 02:56:46 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-11 18:56:46 -0500 |
commit | 3ce14b0c6fbc16d8cdb2cd7354ab3834bf6477ad (patch) | |
tree | 72bb259e2e1c4883ff3af05e10dd9d110db1f9b8 /src/components/PostControls/ShareMenu | |
parent | 9dfddd3c42dcf6916aedeeba2af1663fc39961e1 (diff) | |
download | voidsky-3ce14b0c6fbc16d8cdb2cd7354ab3834bf6477ad.tar.zst |
filter out muted/blocked convos from share menu (#8802)
Diffstat (limited to 'src/components/PostControls/ShareMenu')
-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} |