Bluesky app fork with some witchin' additions 💫 witchsky.app
bluesky fork client
117
fork

Configure Feed

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

feat: Witchsky for Android (show/include "via" fields)

ALSO fix: don't include a facet field if it is empty!!

+24 -1
+12 -1
src/lib/api/index.ts
··· 44 44 type PostDraft, 45 45 type ThreadDraft, 46 46 } from '#/view/com/composer/state/composer' 47 + import {IS_IOS, IS_WEB} from '#/env' 47 48 import {createGIFDescription} from '../gif-alt-text' 48 49 import {detectFacets} from '../strings/detect-facets' 49 50 import {uploadBlob} from './upload-blob' ··· 89 90 const did = agent.assertDid 90 91 const writes: $Typed<ComAtprotoRepoApplyWrites.Create>[] = [] 91 92 const uris: string[] = [] 93 + const via = IS_WEB 94 + ? 'Witchsky Web App' 95 + : IS_IOS 96 + ? 'Witchsky for iPhone' 97 + : 'Witchsky for Android' 92 98 93 99 let now = new Date() 94 100 let tid: TID | undefined ··· 124 130 const rt = await rtPromise 125 131 const embed = await embedPromise 126 132 const reply = await replyPromise 127 - const record: AppBskyFeedPost.Record = { 133 + const record: AppBskyFeedPost.Record & {via: string} = { 134 + via, 128 135 // IMPORTANT: $type has to exist, CID is calculated with the `$type` field 129 136 // present and will produce the wrong CID if you omit it. 130 137 $type: 'app.bsky.feed.post', ··· 235 242 rt.facets = [...nonOverlapping, ...markdownFacets].sort( 236 243 (a, b) => a.index.byteStart - b.index.byteStart, 237 244 ) 245 + } 246 + 247 + if (rt.facets?.length === 0) { 248 + delete rt.facets 238 249 } 239 250 240 251 rt = shortenLinks(rt)
+12
src/screens/PostThread/components/ThreadItemAnchor.tsx
··· 579 579 const t = useTheme() 580 580 const {i18n} = useLingui() 581 581 const isRootPost = !('reply' in post.record) 582 + const via = post.record.via as string | undefined 582 583 583 584 return ( 584 585 <View style={[a.gap_md, a.pt_md, a.align_start]}> ··· 587 588 <Text style={[a.text_sm, t.atoms.text_contrast_medium]}> 588 589 {niceDate(i18n, post.indexedAt, 'dot separated')} 589 590 </Text> 591 + {via ? ( 592 + <Text 593 + numberOfLines={1} 594 + style={[a.text_sm, t.atoms.text_contrast_medium, {maxWidth: 160}]}> 595 + {truncateVia(via)} 596 + </Text> 597 + ) : null} 590 598 {isRootPost && ( 591 599 <WhoCanReply post={post} isThreadAuthor={isThreadAuthor} /> 592 600 )} 593 601 </View> 594 602 </View> 595 603 ) 604 + } 605 + 606 + function truncateVia(via: string) { 607 + return via.length > 24 ? `${via.slice(0, 23)}…` : via 596 608 } 597 609 598 610 function BackdatedPostIndicator({post}: {post: AppBskyFeedDefs.PostView}) {