deer social fork for personal usage. but you might see a use idk. github mirror

verifications: use constellatio filter and fix labelers

commit f2fb9cbade79f4e2dd4a1c07c420691dc6fa827b
Author: Aviva Ruben <aviva@rubenfamily.com>
Date: Fri Apr 25 18:13:00 2025 -0500

allow pointer events to make click work

commit 519f3841b4abd610a0a9191d8eec0dcaabe75aab
Author: Aviva Ruben <aviva@rubenfamily.com>
Date: Fri Apr 25 17:59:54 2025 -0500

show verification mark for labelers

commit ca14e1bd8ddd050e79186ac7ba3325853bcd6136
Author: Aviva Ruben <aviva@rubenfamily.com>
Date: Fri Apr 25 17:55:39 2025 -0500

prevent double close buttons

commit 88ca6cf41ca9217e8404f45c416e90f1a0121c75
Author: Aviva Ruben <aviva@rubenfamily.com>
Date: Fri Apr 25 17:30:54 2025 -0500

use new 'from_dids' param to filter authors

Changed files
+28 -21
src
components
screens
Profile
state
-1
src/components/verification/VerificationsDialog.tsx
··· 40 40 profile={profile} 41 41 verificationState={verificationState} 42 42 /> 43 - <Dialog.Close /> 44 43 </Dialog.Outer> 45 44 ) 46 45 }
-2
src/components/verification/VerifierDialog.tsx
··· 151 151 </Button> 152 152 </View> 153 153 </View> 154 - 155 - <Dialog.Close /> 156 154 </Dialog.ScrollableInner> 157 155 ) 158 156 }
+14 -4
src/screens/Profile/Header/DisplayName.tsx
··· 1 1 import {View} from 'react-native' 2 - import {AppBskyActorDefs, ModerationDecision} from '@atproto/api' 2 + import {type AppBskyActorDefs, type ModerationDecision} from '@atproto/api' 3 3 4 4 import {sanitizeDisplayName} from '#/lib/strings/display-names' 5 5 import {sanitizeHandle} from '#/lib/strings/handles' 6 - import {Shadow} from '#/state/cache/types' 7 - import {atoms as a, useBreakpoints, useTheme} from '#/alf' 6 + import {type Shadow} from '#/state/cache/types' 7 + import {atoms as a, platform, useBreakpoints, useTheme} from '#/alf' 8 8 import {Text} from '#/components/Typography' 9 + import {VerificationCheckButton} from '#/components/verification/VerificationCheckButton' 9 10 10 11 export function ProfileHeaderDisplayName({ 11 12 profile, ··· 18 19 const {gtMobile} = useBreakpoints() 19 20 20 21 return ( 21 - <View pointerEvents="none"> 22 + <View> 22 23 <Text 23 24 emoji 24 25 testID="profileHeaderDisplayName" ··· 32 33 profile.displayName || sanitizeHandle(profile.handle), 33 34 moderation.ui('displayName'), 34 35 )} 36 + <View 37 + style={[ 38 + a.pl_xs, 39 + { 40 + marginTop: platform({ios: 2}), 41 + }, 42 + ]}> 43 + <VerificationCheckButton profile={profile} size="lg" /> 44 + </View> 35 45 </Text> 36 46 </View> 37 47 )
+8 -2
src/state/queries/constellation.ts
··· 28 28 const makeReqUrl = ( 29 29 instance: string, 30 30 route: string, 31 - params: Record<string, string>, 31 + params: Record<string, string | string[]>, 32 32 ) => { 33 33 const url = new URL(instance) 34 34 url.pathname = route 35 35 for (const [k, v] of Object.entries(params)) { 36 - url.searchParams.set(k, v) 36 + // NOTE: in the future this should probably be a repeated param... 37 + if (Array.isArray(v)) { 38 + url.searchParams.set(k, v.join(',')) 39 + } else { 40 + url.searchParams.set(k, v) 41 + } 37 42 } 38 43 return url 39 44 } ··· 46 51 target: string 47 52 collection: Collection 48 53 path: string 54 + from_dids?: string[] 49 55 }, 50 56 ) { 51 57 const url = makeReqUrl(instance, 'links', params)
+6 -12
src/state/queries/deer-verification.ts
··· 18 18 asyncGenCollect, 19 19 asyncGenDedupe, 20 20 asyncGenFilter, 21 - asyncGenTake, 22 21 asyncGenTryMap, 23 22 type ConstellationLink, 24 23 constellationLinks, ··· 49 48 trusted: Set<string>, 50 49 ) { 51 50 const urip = new AtUri(did) 52 - const verificationLinks = asyncGenTake( 53 - constellationLinks(instance, { 54 - target: urip.host, 55 - collection: 'app.bsky.graph.verification', 56 - path: '.subject', 57 - // TODO: remove this when constellation supports filtering 58 - // without a max here, a malicious user could create thousands of verification records and hang a client 59 - // since we can't filter to only trusted verifiers before searching for backlinks yet 60 - }), 61 - 100, 62 - ) 51 + const verificationLinks = constellationLinks(instance, { 52 + target: urip.host, 53 + collection: 'app.bsky.graph.verification', 54 + path: '.subject', 55 + from_dids: Array.from(trusted), 56 + }) 63 57 return asyncGenDedupe( 64 58 asyncGenFilter(verificationLinks, ({did}) => trusted.has(did)), 65 59 ({did}) => did,