Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

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

`Reposted by you` and `Reply to you` (#4478)

Co-authored-by: Hailey <me@haileyok.com>

authored by

Minseo Lee
Hailey
and committed by
GitHub
a71134f4 8b121af2

+62 -35
+19 -11
src/view/com/post/Post.tsx
··· 15 15 import {moderatePost_wrapped as moderatePost} from '#/lib/moderatePost_wrapped' 16 16 import {POST_TOMBSTONE, Shadow, usePostShadow} from '#/state/cache/post-shadow' 17 17 import {useModerationOpts} from '#/state/preferences/moderation-opts' 18 + import {useSession} from '#/state/session' 18 19 import {useComposerControls} from '#/state/shell/composer' 19 20 import {MAX_POST_LINES} from 'lib/constants' 20 21 import {usePalette} from 'lib/hooks/usePalette' ··· 145 146 precacheProfile(queryClient, post.author) 146 147 }, [queryClient, post.author]) 147 148 149 + const {currentAccount} = useSession() 150 + const isMe = replyAuthorDid === currentAccount?.did 151 + 148 152 return ( 149 153 <Link 150 154 href={itemHref} ··· 187 191 style={[pal.textLight, s.mr2]} 188 192 lineHeight={1.2} 189 193 numberOfLines={1}> 190 - <Trans context="description"> 191 - Reply to{' '} 192 - <ProfileHoverCard inline did={replyAuthorDid}> 193 - <UserInfoText 194 - type="sm" 195 - did={replyAuthorDid} 196 - attr="displayName" 197 - style={[pal.textLight]} 198 - /> 199 - </ProfileHoverCard> 200 - </Trans> 194 + {isMe ? ( 195 + <Trans context="description">Reply to you</Trans> 196 + ) : ( 197 + <Trans context="description"> 198 + Reply to{' '} 199 + <ProfileHoverCard inline did={replyAuthorDid}> 200 + <UserInfoText 201 + type="sm" 202 + did={replyAuthorDid} 203 + attr="displayName" 204 + style={[pal.textLight]} 205 + /> 206 + </ProfileHoverCard> 207 + </Trans> 208 + )} 201 209 </Text> 202 210 </View> 203 211 )}
+43 -24
src/view/com/posts/FeedItem.tsx
··· 43 43 import {PreviewableUserAvatar} from '../util/UserAvatar' 44 44 import {AviFollowButton} from './AviFollowButton' 45 45 import hairlineWidth = StyleSheet.hairlineWidth 46 + import {useSession} from '#/state/session' 46 47 import {Repost_Stroke2_Corner2_Rounded as Repost} from '#/components/icons/Repost' 47 48 48 49 interface FeedItemProps { ··· 200 201 }, 201 202 ] 202 203 204 + const {currentAccount} = useSession() 205 + const isOwner = 206 + AppBskyFeedDefs.isReasonRepost(reason) && 207 + reason.by.did === currentAccount?.did 208 + 203 209 return ( 204 210 <Link 205 211 testID={`feedItem-by-${post.author.handle}`} ··· 250 256 <Link 251 257 style={styles.includeReason} 252 258 href={makeProfileLink(reason.by)} 253 - title={_( 254 - msg`Reposted by ${sanitizeDisplayName( 255 - reason.by.displayName || reason.by.handle, 256 - )}`, 257 - )} 259 + title={ 260 + isOwner 261 + ? _(msg`Reposted by you`) 262 + : _( 263 + msg`Reposted by ${sanitizeDisplayName( 264 + reason.by.displayName || reason.by.handle, 265 + )}`, 266 + ) 267 + } 258 268 onBeforePress={onOpenReposter}> 259 269 <Repost 260 270 style={{color: pal.colors.textLight, marginRight: 3}} ··· 266 276 style={pal.textLight} 267 277 lineHeight={1.2} 268 278 numberOfLines={1}> 269 - <Trans> 270 - Reposted by{' '} 271 - <ProfileHoverCard inline did={reason.by.did}> 272 - <TextLinkOnWebOnly 273 - type="sm-bold" 274 - style={pal.textLight} 275 - lineHeight={1.2} 276 - numberOfLines={1} 277 - text={sanitizeDisplayName( 278 - reason.by.displayName || 279 - sanitizeHandle(reason.by.handle), 280 - moderation.ui('displayName'), 281 - )} 282 - href={makeProfileLink(reason.by)} 283 - onBeforePress={onOpenReposter} 284 - /> 285 - </ProfileHoverCard> 286 - </Trans> 279 + {isOwner ? ( 280 + <Trans>Reposted by you</Trans> 281 + ) : ( 282 + <Trans> 283 + Reposted by{' '} 284 + <ProfileHoverCard inline did={reason.by.did}> 285 + <TextLinkOnWebOnly 286 + type="sm-bold" 287 + style={pal.textLight} 288 + lineHeight={1.2} 289 + numberOfLines={1} 290 + text={sanitizeDisplayName( 291 + reason.by.displayName || 292 + sanitizeHandle(reason.by.handle), 293 + moderation.ui('displayName'), 294 + )} 295 + href={makeProfileLink(reason.by)} 296 + onBeforePress={onOpenReposter} 297 + /> 298 + </ProfileHoverCard> 299 + </Trans> 300 + )} 287 301 </Text> 288 302 </Link> 289 303 ) : null} ··· 421 435 blocked?: boolean 422 436 }) { 423 437 const pal = usePalette('default') 438 + const {currentAccount} = useSession() 439 + const isMe = profile.did === currentAccount?.did 440 + 424 441 return ( 425 442 <View style={[s.flexRow, s.mb2, s.alignCenter]}> 426 443 <FontAwesomeIcon ··· 433 450 style={[pal.textLight, s.mr2]} 434 451 lineHeight={1.2} 435 452 numberOfLines={1}> 436 - {blocked ? ( 453 + {isMe ? ( 454 + <Trans context="description">Reply to you</Trans> 455 + ) : blocked ? ( 437 456 <Trans context="description">Reply to a blocked post</Trans> 438 457 ) : ( 439 458 <Trans context="description">