File tree Expand file tree Collapse file tree 3 files changed +44
-4
lines changed
apps/frontend/src/components/launches/providers/bluesky
libraries/nestjs-libraries/src/integrations/social Expand file tree Collapse file tree 3 files changed +44
-4
lines changed Original file line number Diff line number Diff line change 11import { withProvider } from '@gitroom/frontend/components/launches/providers/high.order.provider' ;
2+ import { ThreadFinisher } from '@gitroom/frontend/components/launches/finisher/thread.finisher' ;
3+
4+ const SettingsComponent = ( ) => {
5+ return < ThreadFinisher /> ;
6+ } ;
7+
28export default withProvider (
3- null ,
9+ SettingsComponent ,
410 undefined ,
511 undefined ,
612 async ( posts ) => {
Original file line number Diff line number Diff line change @@ -135,6 +135,7 @@ export class BlueskyProvider extends SocialAbstract implements SocialProvider {
135135 username : profile . data . handle ! ,
136136 } ;
137137 } catch ( e ) {
138+ console . log ( e ) ;
138139 return 'Invalid credentials' ;
139140 }
140141 }
@@ -221,6 +222,41 @@ export class BlueskyProvider extends SocialAbstract implements SocialProvider {
221222 cidUrl . push ( { cid, url : uri , rev : commit . rev } ) ;
222223 }
223224
225+ if ( postDetails ?. [ 0 ] ?. settings ?. active_thread_finisher ) {
226+ const rt = new RichText ( {
227+ text : postDetails ?. [ 0 ] ?. settings ?. thread_finisher ,
228+ } ) ;
229+
230+ await rt . detectFacets ( agent ) ;
231+
232+ await agent . post ( {
233+ text : postDetails ?. [ 0 ] ?. settings ?. thread_finisher ,
234+ facets : rt . facets ,
235+ createdAt : new Date ( ) . toISOString ( ) ,
236+ embed : {
237+ $type : 'app.bsky.embed.record' ,
238+ record : {
239+ uri : cidUrl [ 0 ] . url ,
240+ cid : cidUrl [ 0 ] . cid ,
241+ } ,
242+ } ,
243+ ...( loadCid
244+ ? {
245+ reply : {
246+ root : {
247+ uri : loadUri ,
248+ cid : loadCid ,
249+ } ,
250+ parent : {
251+ uri : loadUri ,
252+ cid : loadCid ,
253+ } ,
254+ } ,
255+ }
256+ : { } ) ,
257+ } ) ;
258+ }
259+
224260 return postDetails . map ( ( p , index ) => ( {
225261 id : p . id ,
226262 postId : cidUrl [ index ] . url ,
Original file line number Diff line number Diff line change @@ -411,9 +411,7 @@ export class ThreadsProvider extends SocialAbstract implements SocialProvider {
411411 id : makeId ( 10 ) ,
412412 media : [ ] ,
413413 message :
414- postDetails ?. [ 0 ] ?. settings ?. thread_finisher ! +
415- '\n' +
416- responses [ 0 ] . releaseURL ,
414+ postDetails ?. [ 0 ] ?. settings ?. thread_finisher ,
417415 settings : { } ,
418416 } ,
419417 lastReplyId ,
You can’t perform that action at this time.
0 commit comments