Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Don't follow self, blocks or mute when following all; don't show blocks in list (#4715)

* don't follow self when following all

* also filter blocks

* add more filtering to follow all

* extract logic to functions

authored by

Hailey and committed by
GitHub
6694a336 dc3c81c4

+27 -2
+2 -1
src/components/StarterPack/Main/ProfilesList.tsx
··· 9 9 import {InfiniteData, UseInfiniteQueryResult} from '@tanstack/react-query' 10 10 11 11 import {useBottomBarOffset} from 'lib/hooks/useBottomBarOffset' 12 + import {isBlockedOrBlocking} from 'lib/moderation/blocked-and-muted' 12 13 import {isNative, isWeb} from 'platform/detection' 13 14 import {useSession} from 'state/session' 14 15 import {List, ListRef} from 'view/com/util/List' ··· 47 48 // The server returns these sorted by descending creation date, so we want to invert 48 49 const profiles = data?.pages 49 50 .flatMap(p => p.items.map(i => i.subject)) 50 - .filter(p => !p.associated?.labeler) 51 + .filter(p => !isBlockedOrBlocking(p) && !p.associated?.labeler) 51 52 .reverse() 52 53 const isOwn = new AtUri(listUri).host === currentAccount?.did 53 54
+17
src/lib/moderation/blocked-and-muted.ts
··· 1 + import {AppBskyActorDefs} from '@atproto/api' 2 + 3 + export function isBlockedOrBlocking( 4 + profile: 5 + | AppBskyActorDefs.ProfileViewBasic 6 + | AppBskyActorDefs.ProfileViewDetailed, 7 + ) { 8 + return profile.viewer?.blockedBy || profile.viewer?.blocking 9 + } 10 + 11 + export function isMuted( 12 + profile: 13 + | AppBskyActorDefs.ProfileViewBasic 14 + | AppBskyActorDefs.ProfileViewDetailed, 15 + ) { 16 + return profile.viewer?.muted || profile.viewer?.mutedByList 17 + }
+8 -1
src/screens/StarterPack/StarterPackScreen.tsx
··· 25 25 import {useDeleteStarterPackMutation} from '#/state/queries/starter-packs' 26 26 import {batchedUpdates} from 'lib/batchedUpdates' 27 27 import {HITSLOP_20} from 'lib/constants' 28 + import {isBlockedOrBlocking, isMuted} from 'lib/moderation/blocked-and-muted' 28 29 import {makeProfileLink, makeStarterPackLink} from 'lib/routes/links' 29 30 import {CommonNavigatorParams, NavigationProp} from 'lib/routes/types' 30 31 import {logEvent} from 'lib/statsig/statsig' ··· 344 345 list: starterPack.list.uri, 345 346 }) 346 347 const dids = list.data.items 347 - .filter(li => !li.subject.viewer?.following) 348 + .filter( 349 + li => 350 + li.subject.did !== currentAccount?.did && 351 + !isBlockedOrBlocking(li.subject) && 352 + !isMuted(li.subject) && 353 + !li.subject.viewer?.following, 354 + ) 348 355 .map(li => li.subject.did) 349 356 350 357 const followUris = await bulkWriteFollows(agent, dids)