about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2025-08-12 02:56:46 +0300
committerGitHub <noreply@github.com>2025-08-11 18:56:46 -0500
commit3ce14b0c6fbc16d8cdb2cd7354ab3834bf6477ad (patch)
tree72bb259e2e1c4883ff3af05e10dd9d110db1f9b8 /src
parent9dfddd3c42dcf6916aedeeba2af1663fc39961e1 (diff)
downloadvoidsky-3ce14b0c6fbc16d8cdb2cd7354ab3834bf6477ad.tar.zst
filter out muted/blocked convos from share menu (#8802)
Diffstat (limited to 'src')
-rw-r--r--src/components/PostControls/ShareMenu/RecentChats.tsx16
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}