this repo has no description
0
fork

Configure Feed

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

more federation work, it does things!

+220 -124
+2 -2
api/atproto/accountcreate.go
··· 15 15 LexiconTypeID string `json:"$type,omitempty"` 16 16 Email string `json:"email" cborgen:"email"` 17 17 Handle string `json:"handle" cborgen:"handle"` 18 - InviteCode *string `json:"inviteCode" cborgen:"inviteCode"` 18 + InviteCode *string `json:"inviteCode,omitempty" cborgen:"inviteCode"` 19 19 Password string `json:"password" cborgen:"password"` 20 - RecoveryKey *string `json:"recoveryKey" cborgen:"recoveryKey"` 20 + RecoveryKey *string `json:"recoveryKey,omitempty" cborgen:"recoveryKey"` 21 21 } 22 22 23 23 type AccountCreate_Output struct {
+2 -2
api/atproto/repobatchWrite.go
··· 18 18 LexiconTypeID string `json:"$type,omitempty"` 19 19 Action string `json:"action" cborgen:"action"` 20 20 Collection string `json:"collection" cborgen:"collection"` 21 - Rkey *string `json:"rkey" cborgen:"rkey"` 21 + Rkey *string `json:"rkey,omitempty" cborgen:"rkey"` 22 22 Value any `json:"value" cborgen:"value"` 23 23 } 24 24 ··· 32 32 type RepoBatchWrite_Input struct { 33 33 LexiconTypeID string `json:"$type,omitempty"` 34 34 Did string `json:"did" cborgen:"did"` 35 - Validate *bool `json:"validate" cborgen:"validate"` 35 + Validate *bool `json:"validate,omitempty" cborgen:"validate"` 36 36 Writes []*RepoBatchWrite_Input_Writes_Elem `json:"writes" cborgen:"writes"` 37 37 } 38 38
+1 -1
api/atproto/repocreateRecord.go
··· 16 16 Collection string `json:"collection" cborgen:"collection"` 17 17 Did string `json:"did" cborgen:"did"` 18 18 Record any `json:"record" cborgen:"record"` 19 - Validate *bool `json:"validate" cborgen:"validate"` 19 + Validate *bool `json:"validate,omitempty" cborgen:"validate"` 20 20 } 21 21 22 22 type RepoCreateRecord_Output struct {
+1 -1
api/atproto/repogetRecord.go
··· 13 13 14 14 type RepoGetRecord_Output struct { 15 15 LexiconTypeID string `json:"$type,omitempty"` 16 - Cid *string `json:"cid" cborgen:"cid"` 16 + Cid *string `json:"cid,omitempty" cborgen:"cid"` 17 17 Uri string `json:"uri" cborgen:"uri"` 18 18 Value any `json:"value" cborgen:"value"` 19 19 }
+1 -1
api/atproto/repolistRecords.go
··· 13 13 14 14 type RepoListRecords_Output struct { 15 15 LexiconTypeID string `json:"$type,omitempty"` 16 - Cursor *string `json:"cursor" cborgen:"cursor"` 16 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor"` 17 17 Records []*RepoListRecords_Record `json:"records" cborgen:"records"` 18 18 } 19 19
+1 -1
api/atproto/repoputRecord.go
··· 17 17 Did string `json:"did" cborgen:"did"` 18 18 Record any `json:"record" cborgen:"record"` 19 19 Rkey string `json:"rkey" cborgen:"rkey"` 20 - Validate *bool `json:"validate" cborgen:"validate"` 20 + Validate *bool `json:"validate,omitempty" cborgen:"validate"` 21 21 } 22 22 23 23 type RepoPutRecord_Output struct {
+2 -2
api/atproto/servergetAccountsConfig.go
··· 20 20 type ServerGetAccountsConfig_Output struct { 21 21 LexiconTypeID string `json:"$type,omitempty"` 22 22 AvailableUserDomains []string `json:"availableUserDomains" cborgen:"availableUserDomains"` 23 - InviteCodeRequired *bool `json:"inviteCodeRequired" cborgen:"inviteCodeRequired"` 24 - Links *ServerGetAccountsConfig_Links `json:"links" cborgen:"links"` 23 + InviteCodeRequired *bool `json:"inviteCodeRequired,omitempty" cborgen:"inviteCodeRequired"` 24 + Links *ServerGetAccountsConfig_Links `json:"links,omitempty" cborgen:"links"` 25 25 } 26 26 27 27 func ServerGetAccountsConfig(ctx context.Context, c *xrpc.Client) (*ServerGetAccountsConfig_Output, error) {
+1 -1
api/bsky/actorcreateScene.go
··· 14 14 type ActorCreateScene_Input struct { 15 15 LexiconTypeID string `json:"$type,omitempty"` 16 16 Handle string `json:"handle" cborgen:"handle"` 17 - RecoveryKey *string `json:"recoveryKey" cborgen:"recoveryKey"` 17 + RecoveryKey *string `json:"recoveryKey,omitempty" cborgen:"recoveryKey"` 18 18 } 19 19 20 20 type ActorCreateScene_Output struct {
+8 -8
api/bsky/actorgetProfile.go
··· 13 13 14 14 type ActorGetProfile_MyState struct { 15 15 LexiconTypeID string `json:"$type,omitempty"` 16 - Follow *string `json:"follow" cborgen:"follow"` 17 - Member *string `json:"member" cborgen:"member"` 18 - Muted *bool `json:"muted" cborgen:"muted"` 16 + Follow *string `json:"follow,omitempty" cborgen:"follow"` 17 + Member *string `json:"member,omitempty" cborgen:"member"` 18 + Muted *bool `json:"muted,omitempty" cborgen:"muted"` 19 19 } 20 20 21 21 type ActorGetProfile_Output struct { 22 22 LexiconTypeID string `json:"$type,omitempty"` 23 - Avatar *string `json:"avatar" cborgen:"avatar"` 24 - Banner *string `json:"banner" cborgen:"banner"` 23 + Avatar *string `json:"avatar,omitempty" cborgen:"avatar"` 24 + Banner *string `json:"banner,omitempty" cborgen:"banner"` 25 25 Creator string `json:"creator" cborgen:"creator"` 26 26 Declaration *SystemDeclRef `json:"declaration" cborgen:"declaration"` 27 - Description *string `json:"description" cborgen:"description"` 27 + Description *string `json:"description,omitempty" cborgen:"description"` 28 28 Did string `json:"did" cborgen:"did"` 29 - DisplayName *string `json:"displayName" cborgen:"displayName"` 29 + DisplayName *string `json:"displayName,omitempty" cborgen:"displayName"` 30 30 FollowersCount int64 `json:"followersCount" cborgen:"followersCount"` 31 31 FollowsCount int64 `json:"followsCount" cborgen:"followsCount"` 32 32 Handle string `json:"handle" cborgen:"handle"` 33 33 MembersCount int64 `json:"membersCount" cborgen:"membersCount"` 34 - MyState *ActorGetProfile_MyState `json:"myState" cborgen:"myState"` 34 + MyState *ActorGetProfile_MyState `json:"myState,omitempty" cborgen:"myState"` 35 35 PostsCount int64 `json:"postsCount" cborgen:"postsCount"` 36 36 } 37 37
+7 -7
api/bsky/actorgetSuggestions.go
··· 13 13 14 14 type ActorGetSuggestions_Actor struct { 15 15 LexiconTypeID string `json:"$type,omitempty"` 16 - Avatar *string `json:"avatar" cborgen:"avatar"` 16 + Avatar *string `json:"avatar,omitempty" cborgen:"avatar"` 17 17 Declaration *SystemDeclRef `json:"declaration" cborgen:"declaration"` 18 - Description *string `json:"description" cborgen:"description"` 18 + Description *string `json:"description,omitempty" cborgen:"description"` 19 19 Did string `json:"did" cborgen:"did"` 20 - DisplayName *string `json:"displayName" cborgen:"displayName"` 20 + DisplayName *string `json:"displayName,omitempty" cborgen:"displayName"` 21 21 Handle string `json:"handle" cborgen:"handle"` 22 - IndexedAt *string `json:"indexedAt" cborgen:"indexedAt"` 23 - MyState *ActorGetSuggestions_MyState `json:"myState" cborgen:"myState"` 22 + IndexedAt *string `json:"indexedAt,omitempty" cborgen:"indexedAt"` 23 + MyState *ActorGetSuggestions_MyState `json:"myState,omitempty" cborgen:"myState"` 24 24 } 25 25 26 26 type ActorGetSuggestions_MyState struct { 27 27 LexiconTypeID string `json:"$type,omitempty"` 28 - Follow *string `json:"follow" cborgen:"follow"` 28 + Follow *string `json:"follow,omitempty" cborgen:"follow"` 29 29 } 30 30 31 31 type ActorGetSuggestions_Output struct { 32 32 LexiconTypeID string `json:"$type,omitempty"` 33 33 Actors []*ActorGetSuggestions_Actor `json:"actors" cborgen:"actors"` 34 - Cursor *string `json:"cursor" cborgen:"cursor"` 34 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor"` 35 35 } 36 36 37 37 func ActorGetSuggestions(ctx context.Context, c *xrpc.Client, cursor string, limit int64) (*ActorGetSuggestions_Output, error) {
+3 -3
api/bsky/actorprofile.go
··· 13 13 // RECORDTYPE: ActorProfile 14 14 type ActorProfile struct { 15 15 LexiconTypeID string `json:"$type" cborgen:"$type,const=app.bsky.actor.profile"` 16 - Avatar *util.Blob `json:"avatar" cborgen:"avatar"` 17 - Banner *util.Blob `json:"banner" cborgen:"banner"` 18 - Description *string `json:"description" cborgen:"description"` 16 + Avatar *util.Blob `json:"avatar,omitempty" cborgen:"avatar"` 17 + Banner *util.Blob `json:"banner,omitempty" cborgen:"banner"` 18 + Description *string `json:"description,omitempty" cborgen:"description"` 19 19 DisplayName string `json:"displayName" cborgen:"displayName"` 20 20 }
+4 -4
api/bsky/actorref.go
··· 13 13 14 14 type ActorRef_ViewerState struct { 15 15 LexiconTypeID string `json:"$type,omitempty"` 16 - Muted *bool `json:"muted" cborgen:"muted"` 16 + Muted *bool `json:"muted,omitempty" cborgen:"muted"` 17 17 } 18 18 19 19 type ActorRef_WithInfo struct { 20 20 LexiconTypeID string `json:"$type,omitempty"` 21 - Avatar *string `json:"avatar" cborgen:"avatar"` 21 + Avatar *string `json:"avatar,omitempty" cborgen:"avatar"` 22 22 Declaration *SystemDeclRef `json:"declaration" cborgen:"declaration"` 23 23 Did string `json:"did" cborgen:"did"` 24 - DisplayName *string `json:"displayName" cborgen:"displayName"` 24 + DisplayName *string `json:"displayName,omitempty" cborgen:"displayName"` 25 25 Handle string `json:"handle" cborgen:"handle"` 26 - Viewer *ActorRef_ViewerState `json:"viewer" cborgen:"viewer"` 26 + Viewer *ActorRef_ViewerState `json:"viewer,omitempty" cborgen:"viewer"` 27 27 }
+5 -5
api/bsky/actorsearch.go
··· 13 13 14 14 type ActorSearch_Output struct { 15 15 LexiconTypeID string `json:"$type,omitempty"` 16 - Cursor *string `json:"cursor" cborgen:"cursor"` 16 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor"` 17 17 Users []*ActorSearch_User `json:"users" cborgen:"users"` 18 18 } 19 19 20 20 type ActorSearch_User struct { 21 21 LexiconTypeID string `json:"$type,omitempty"` 22 - Avatar *string `json:"avatar" cborgen:"avatar"` 22 + Avatar *string `json:"avatar,omitempty" cborgen:"avatar"` 23 23 Declaration *SystemDeclRef `json:"declaration" cborgen:"declaration"` 24 - Description *string `json:"description" cborgen:"description"` 24 + Description *string `json:"description,omitempty" cborgen:"description"` 25 25 Did string `json:"did" cborgen:"did"` 26 - DisplayName *string `json:"displayName" cborgen:"displayName"` 26 + DisplayName *string `json:"displayName,omitempty" cborgen:"displayName"` 27 27 Handle string `json:"handle" cborgen:"handle"` 28 - IndexedAt *string `json:"indexedAt" cborgen:"indexedAt"` 28 + IndexedAt *string `json:"indexedAt,omitempty" cborgen:"indexedAt"` 29 29 } 30 30 31 31 func ActorSearch(ctx context.Context, c *xrpc.Client, before string, limit int64, term string) (*ActorSearch_Output, error) {
+2 -2
api/bsky/actorsearchTypeahead.go
··· 18 18 19 19 type ActorSearchTypeahead_User struct { 20 20 LexiconTypeID string `json:"$type,omitempty"` 21 - Avatar *string `json:"avatar" cborgen:"avatar"` 21 + Avatar *string `json:"avatar,omitempty" cborgen:"avatar"` 22 22 Declaration *SystemDeclRef `json:"declaration" cborgen:"declaration"` 23 23 Did string `json:"did" cborgen:"did"` 24 - DisplayName *string `json:"displayName" cborgen:"displayName"` 24 + DisplayName *string `json:"displayName,omitempty" cborgen:"displayName"` 25 25 Handle string `json:"handle" cborgen:"handle"` 26 26 } 27 27
+5 -5
api/bsky/actorupdateProfile.go
··· 14 14 15 15 type ActorUpdateProfile_Input struct { 16 16 LexiconTypeID string `json:"$type,omitempty"` 17 - Avatar *util.Blob `json:"avatar" cborgen:"avatar"` 18 - Banner *util.Blob `json:"banner" cborgen:"banner"` 19 - Description *string `json:"description" cborgen:"description"` 20 - Did *string `json:"did" cborgen:"did"` 21 - DisplayName *string `json:"displayName" cborgen:"displayName"` 17 + Avatar *util.Blob `json:"avatar,omitempty" cborgen:"avatar"` 18 + Banner *util.Blob `json:"banner,omitempty" cborgen:"banner"` 19 + Description *string `json:"description,omitempty" cborgen:"description"` 20 + Did *string `json:"did,omitempty" cborgen:"did"` 21 + DisplayName *string `json:"displayName,omitempty" cborgen:"displayName"` 22 22 } 23 23 24 24 type ActorUpdateProfile_Output struct {
+2 -2
api/bsky/embedexternal.go
··· 17 17 type EmbedExternal_External struct { 18 18 LexiconTypeID string `json:"$type,omitempty"` 19 19 Description string `json:"description" cborgen:"description"` 20 - Thumb *util.Blob `json:"thumb" cborgen:"thumb"` 20 + Thumb *util.Blob `json:"thumb,omitempty" cborgen:"thumb"` 21 21 Title string `json:"title" cborgen:"title"` 22 22 Uri string `json:"uri" cborgen:"uri"` 23 23 } ··· 30 30 type EmbedExternal_PresentedExternal struct { 31 31 LexiconTypeID string `json:"$type,omitempty"` 32 32 Description string `json:"description" cborgen:"description"` 33 - Thumb *string `json:"thumb" cborgen:"thumb"` 33 + Thumb *string `json:"thumb,omitempty" cborgen:"thumb"` 34 34 Title string `json:"title" cborgen:"title"` 35 35 Uri string `json:"uri" cborgen:"uri"` 36 36 }
+1 -1
api/bsky/feedfeedViewPost.go
··· 14 14 15 15 type FeedFeedViewPost struct { 16 16 LexiconTypeID string `json:"$type,omitempty"` 17 - Post *FeedPost_View `json:"post,omitempty" cborgen:"post"` 17 + Post *FeedPost_View `json:"post" cborgen:"post"` 18 18 Reason *FeedFeedViewPost_Reason `json:"reason,omitempty" cborgen:"reason"` 19 19 Reply *FeedFeedViewPost_ReplyRef `json:"reply,omitempty" cborgen:"reply"` 20 20 }
+1 -1
api/bsky/feedgetAuthorFeed.go
··· 13 13 14 14 type FeedGetAuthorFeed_Output struct { 15 15 LexiconTypeID string `json:"$type,omitempty"` 16 - Cursor *string `json:"cursor" cborgen:"cursor"` 16 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor"` 17 17 Feed []*FeedFeedViewPost `json:"feed" cborgen:"feed"` 18 18 } 19 19
+2 -2
api/bsky/feedgetPostThread.go
··· 62 62 63 63 type FeedGetPostThread_ThreadViewPost struct { 64 64 LexiconTypeID string `json:"$type,omitempty"` 65 - Parent *FeedGetPostThread_ThreadViewPost_Parent `json:"parent" cborgen:"parent"` 65 + Parent *FeedGetPostThread_ThreadViewPost_Parent `json:"parent,omitempty" cborgen:"parent"` 66 66 Post *FeedPost_View `json:"post" cborgen:"post"` 67 - Replies []*FeedGetPostThread_ThreadViewPost_Replies_Elem `json:"replies" cborgen:"replies"` 67 + Replies []*FeedGetPostThread_ThreadViewPost_Replies_Elem `json:"replies,omitempty" cborgen:"replies"` 68 68 } 69 69 70 70 type FeedGetPostThread_ThreadViewPost_Parent struct {
+5 -5
api/bsky/feedgetRepostedBy.go
··· 13 13 14 14 type FeedGetRepostedBy_Output struct { 15 15 LexiconTypeID string `json:"$type,omitempty"` 16 - Cid *string `json:"cid" cborgen:"cid"` 17 - Cursor *string `json:"cursor" cborgen:"cursor"` 16 + Cid *string `json:"cid,omitempty" cborgen:"cid"` 17 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor"` 18 18 RepostedBy []*FeedGetRepostedBy_RepostedBy `json:"repostedBy" cborgen:"repostedBy"` 19 19 Uri string `json:"uri" cborgen:"uri"` 20 20 } 21 21 22 22 type FeedGetRepostedBy_RepostedBy struct { 23 23 LexiconTypeID string `json:"$type,omitempty"` 24 - Avatar *string `json:"avatar" cborgen:"avatar"` 25 - CreatedAt *string `json:"createdAt" cborgen:"createdAt"` 24 + Avatar *string `json:"avatar,omitempty" cborgen:"avatar"` 25 + CreatedAt *string `json:"createdAt,omitempty" cborgen:"createdAt"` 26 26 Declaration *SystemDeclRef `json:"declaration" cborgen:"declaration"` 27 27 Did string `json:"did" cborgen:"did"` 28 - DisplayName *string `json:"displayName" cborgen:"displayName"` 28 + DisplayName *string `json:"displayName,omitempty" cborgen:"displayName"` 29 29 Handle string `json:"handle" cborgen:"handle"` 30 30 IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 31 31 }
+2 -2
api/bsky/feedgetVotes.go
··· 13 13 14 14 type FeedGetVotes_Output struct { 15 15 LexiconTypeID string `json:"$type,omitempty"` 16 - Cid *string `json:"cid" cborgen:"cid"` 17 - Cursor *string `json:"cursor" cborgen:"cursor"` 16 + Cid *string `json:"cid,omitempty" cborgen:"cid"` 17 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor"` 18 18 Uri string `json:"uri" cborgen:"uri"` 19 19 Votes []*FeedGetVotes_Vote `json:"votes" cborgen:"votes"` 20 20 }
+9 -8
api/bsky/feedpost.go
··· 21 21 type FeedPost struct { 22 22 LexiconTypeID string `json:"$type" cborgen:"$type,const=app.bsky.feed.post"` 23 23 CreatedAt string `json:"createdAt" cborgen:"createdAt"` 24 - Embed *FeedPost_Embed `json:"embed" cborgen:"embed"` 25 - Entities []*FeedPost_Entity `json:"entities" cborgen:"entities"` 26 - Reply *FeedPost_ReplyRef `json:"reply" cborgen:"reply"` 24 + Embed *FeedPost_Embed `json:"embed,omitempty" cborgen:"embed"` 25 + Entities []*FeedPost_Entity `json:"entities,omitempty" cborgen:"entities"` 26 + Reply *FeedPost_ReplyRef `json:"reply,omitempty" cborgen:"reply"` 27 27 Text string `json:"text" cborgen:"text"` 28 28 } 29 29 ··· 116 116 117 117 type FeedPost_View struct { 118 118 LexiconTypeID string `json:"$type,omitempty"` 119 - Author *ActorRef_WithInfo `json:"author,omitempty" cborgen:"author"` 119 + Author *ActorRef_WithInfo `json:"author" cborgen:"author"` 120 120 Cid string `json:"cid" cborgen:"cid"` 121 121 DownvoteCount int64 `json:"downvoteCount" cborgen:"downvoteCount"` 122 122 Embed *FeedPost_View_Embed `json:"embed,omitempty" cborgen:"embed"` ··· 126 126 RepostCount int64 `json:"repostCount" cborgen:"repostCount"` 127 127 UpvoteCount int64 `json:"upvoteCount" cborgen:"upvoteCount"` 128 128 Uri string `json:"uri" cborgen:"uri"` 129 - Viewer *FeedPost_ViewerState `json:"viewer,omitempty" cborgen:"viewer"` 129 + Viewer *FeedPost_ViewerState `json:"viewer" cborgen:"viewer"` 130 130 } 131 131 132 132 type FeedPost_View_Embed struct { ··· 166 166 167 167 type FeedPost_ViewerState struct { 168 168 LexiconTypeID string `json:"$type,omitempty"` 169 - Downvote *string `json:"downvote" cborgen:"downvote"` 170 - Repost *string `json:"repost" cborgen:"repost"` 171 - Upvote *string `json:"upvote" cborgen:"upvote"` 169 + Downvote *string `json:"downvote,omitempty" cborgen:"downvote"` 170 + Muted *bool `json:"muted,omitempty" cborgen:"muted"` 171 + Repost *string `json:"repost,omitempty" cborgen:"repost"` 172 + Upvote *string `json:"upvote,omitempty" cborgen:"upvote"` 172 173 }
+2 -2
api/bsky/feedsetVote.go
··· 20 20 21 21 type FeedSetVote_Output struct { 22 22 LexiconTypeID string `json:"$type,omitempty"` 23 - Downvote *string `json:"downvote" cborgen:"downvote"` 24 - Upvote *string `json:"upvote" cborgen:"upvote"` 23 + Downvote *string `json:"downvote,omitempty" cborgen:"downvote"` 24 + Upvote *string `json:"upvote,omitempty" cborgen:"upvote"` 25 25 } 26 26 27 27 func FeedSetVote(ctx context.Context, c *xrpc.Client, input *FeedSetVote_Input) (*FeedSetVote_Output, error) {
+2 -2
api/bsky/graphgetAssertions.go
··· 16 16 Assertion string `json:"assertion" cborgen:"assertion"` 17 17 Author *ActorRef_WithInfo `json:"author" cborgen:"author"` 18 18 Cid string `json:"cid" cborgen:"cid"` 19 - Confirmation *GraphGetAssertions_Confirmation `json:"confirmation" cborgen:"confirmation"` 19 + Confirmation *GraphGetAssertions_Confirmation `json:"confirmation,omitempty" cborgen:"confirmation"` 20 20 CreatedAt string `json:"createdAt" cborgen:"createdAt"` 21 21 IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 22 22 Subject *ActorRef_WithInfo `json:"subject" cborgen:"subject"` ··· 34 34 type GraphGetAssertions_Output struct { 35 35 LexiconTypeID string `json:"$type,omitempty"` 36 36 Assertions []*GraphGetAssertions_Assertion `json:"assertions" cborgen:"assertions"` 37 - Cursor *string `json:"cursor" cborgen:"cursor"` 37 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor"` 38 38 } 39 39 40 40 func GraphGetAssertions(ctx context.Context, c *xrpc.Client, assertion string, author string, before string, confirmed bool, limit int64, subject string) (*GraphGetAssertions_Output, error) {
+4 -4
api/bsky/graphgetFollowers.go
··· 13 13 14 14 type GraphGetFollowers_Follower struct { 15 15 LexiconTypeID string `json:"$type,omitempty"` 16 - Avatar *string `json:"avatar" cborgen:"avatar"` 17 - CreatedAt *string `json:"createdAt" cborgen:"createdAt"` 16 + Avatar *string `json:"avatar,omitempty" cborgen:"avatar"` 17 + CreatedAt *string `json:"createdAt,omitempty" cborgen:"createdAt"` 18 18 Declaration *SystemDeclRef `json:"declaration" cborgen:"declaration"` 19 19 Did string `json:"did" cborgen:"did"` 20 - DisplayName *string `json:"displayName" cborgen:"displayName"` 20 + DisplayName *string `json:"displayName,omitempty" cborgen:"displayName"` 21 21 Handle string `json:"handle" cborgen:"handle"` 22 22 IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 23 23 } 24 24 25 25 type GraphGetFollowers_Output struct { 26 26 LexiconTypeID string `json:"$type,omitempty"` 27 - Cursor *string `json:"cursor" cborgen:"cursor"` 27 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor"` 28 28 Followers []*GraphGetFollowers_Follower `json:"followers" cborgen:"followers"` 29 29 Subject *ActorRef_WithInfo `json:"subject" cborgen:"subject"` 30 30 }
+3 -3
api/bsky/graphgetFollows.go
··· 13 13 14 14 type GraphGetFollows_Follow struct { 15 15 LexiconTypeID string `json:"$type,omitempty"` 16 - CreatedAt *string `json:"createdAt" cborgen:"createdAt"` 16 + CreatedAt *string `json:"createdAt,omitempty" cborgen:"createdAt"` 17 17 Declaration *SystemDeclRef `json:"declaration" cborgen:"declaration"` 18 18 Did string `json:"did" cborgen:"did"` 19 - DisplayName *string `json:"displayName" cborgen:"displayName"` 19 + DisplayName *string `json:"displayName,omitempty" cborgen:"displayName"` 20 20 Handle string `json:"handle" cborgen:"handle"` 21 21 IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 22 22 } 23 23 24 24 type GraphGetFollows_Output struct { 25 25 LexiconTypeID string `json:"$type,omitempty"` 26 - Cursor *string `json:"cursor" cborgen:"cursor"` 26 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor"` 27 27 Follows []*GraphGetFollows_Follow `json:"follows" cborgen:"follows"` 28 28 Subject *ActorRef_WithInfo `json:"subject" cborgen:"subject"` 29 29 }
+3 -3
api/bsky/graphgetMembers.go
··· 13 13 14 14 type GraphGetMembers_Member struct { 15 15 LexiconTypeID string `json:"$type,omitempty"` 16 - CreatedAt *string `json:"createdAt" cborgen:"createdAt"` 16 + CreatedAt *string `json:"createdAt,omitempty" cborgen:"createdAt"` 17 17 Declaration *SystemDeclRef `json:"declaration" cborgen:"declaration"` 18 18 Did string `json:"did" cborgen:"did"` 19 - DisplayName *string `json:"displayName" cborgen:"displayName"` 19 + DisplayName *string `json:"displayName,omitempty" cborgen:"displayName"` 20 20 Handle string `json:"handle" cborgen:"handle"` 21 21 IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 22 22 } 23 23 24 24 type GraphGetMembers_Output struct { 25 25 LexiconTypeID string `json:"$type,omitempty"` 26 - Cursor *string `json:"cursor" cborgen:"cursor"` 26 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor"` 27 27 Members []*GraphGetMembers_Member `json:"members" cborgen:"members"` 28 28 Subject *ActorRef_WithInfo `json:"subject" cborgen:"subject"` 29 29 }
+3 -3
api/bsky/graphgetMemberships.go
··· 13 13 14 14 type GraphGetMemberships_Membership struct { 15 15 LexiconTypeID string `json:"$type,omitempty"` 16 - CreatedAt *string `json:"createdAt" cborgen:"createdAt"` 16 + CreatedAt *string `json:"createdAt,omitempty" cborgen:"createdAt"` 17 17 Declaration *SystemDeclRef `json:"declaration" cborgen:"declaration"` 18 18 Did string `json:"did" cborgen:"did"` 19 - DisplayName *string `json:"displayName" cborgen:"displayName"` 19 + DisplayName *string `json:"displayName,omitempty" cborgen:"displayName"` 20 20 Handle string `json:"handle" cborgen:"handle"` 21 21 IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 22 22 } 23 23 24 24 type GraphGetMemberships_Output struct { 25 25 LexiconTypeID string `json:"$type,omitempty"` 26 - Cursor *string `json:"cursor" cborgen:"cursor"` 26 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor"` 27 27 Memberships []*GraphGetMemberships_Membership `json:"memberships" cborgen:"memberships"` 28 28 Subject *ActorRef_WithInfo `json:"subject" cborgen:"subject"` 29 29 }
+2 -2
api/bsky/graphgetMutes.go
··· 16 16 CreatedAt string `json:"createdAt" cborgen:"createdAt"` 17 17 Declaration *SystemDeclRef `json:"declaration" cborgen:"declaration"` 18 18 Did string `json:"did" cborgen:"did"` 19 - DisplayName *string `json:"displayName" cborgen:"displayName"` 19 + DisplayName *string `json:"displayName,omitempty" cborgen:"displayName"` 20 20 Handle string `json:"handle" cborgen:"handle"` 21 21 } 22 22 23 23 type GraphGetMutes_Output struct { 24 24 LexiconTypeID string `json:"$type,omitempty"` 25 - Cursor *string `json:"cursor" cborgen:"cursor"` 25 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor"` 26 26 Mutes []*GraphGetMutes_Mute `json:"mutes" cborgen:"mutes"` 27 27 } 28 28
+2 -2
api/bsky/notificationlist.go
··· 18 18 IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 19 19 IsRead bool `json:"isRead" cborgen:"isRead"` 20 20 Reason string `json:"reason" cborgen:"reason"` 21 - ReasonSubject *string `json:"reasonSubject" cborgen:"reasonSubject"` 21 + ReasonSubject *string `json:"reasonSubject,omitempty" cborgen:"reasonSubject"` 22 22 Record any `json:"record" cborgen:"record"` 23 23 Uri string `json:"uri" cborgen:"uri"` 24 24 } 25 25 26 26 type NotificationList_Output struct { 27 27 LexiconTypeID string `json:"$type,omitempty"` 28 - Cursor *string `json:"cursor" cborgen:"cursor"` 28 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor"` 29 29 Notifications []*NotificationList_Notification `json:"notifications" cborgen:"notifications"` 30 30 } 31 31
+1 -1
lex/gen.go
··· 1018 1018 var ptr string 1019 1019 var omit string 1020 1020 if !required[k] { 1021 + omit = ",omitempty" 1021 1022 if !strings.HasPrefix(tname, "*") && !strings.HasPrefix(tname, "[]") { 1022 1023 ptr = "*" 1023 - omit = ",omitempty" 1024 1024 } 1025 1025 } 1026 1026
+9 -2
repomgr/repomgr.go
··· 13 13 "github.com/whyrusleeping/gosky/repo" 14 14 "go.opentelemetry.io/otel" 15 15 "gorm.io/gorm" 16 + "gorm.io/gorm/clause" 16 17 ) 17 18 18 19 func NewRepoManager(db *gorm.DB, cs *carstore.CarStore) *RepoManager { ··· 71 72 72 73 type RepoHead struct { 73 74 gorm.Model 74 - Usr uint `gorm:"index"` 75 + Usr uint `gorm:"uniqueIndex"` 75 76 Root string 76 77 } 77 78 ··· 129 130 } 130 131 131 132 func (rm *RepoManager) updateUserRepoHead(ctx context.Context, user uint, root cid.Cid) error { 132 - if err := rm.db.WithContext(ctx).Model(RepoHead{}).Where("usr = ?", user).Update("root", root.String()).Error; err != nil { 133 + if err := rm.db.WithContext(ctx).Clauses(clause.OnConflict{ 134 + Columns: []clause.Column{{Name: "usr"}}, 135 + DoUpdates: clause.AssignmentColumns([]string{"root"}), 136 + }).Create(&RepoHead{ 137 + Usr: user, 138 + Root: root.String(), 139 + }).Error; err != nil { 133 140 return err 134 141 } 135 142
+9 -3
server/events.go
··· 90 90 CarSlice []byte 91 91 92 92 // some private fields for processing metadata 93 - uid uint 94 - pdsid uint 93 + uid uint 94 + pdsid uint 95 + relevantPds []uint 95 96 } 96 97 97 98 func (em *EventManager) AddEvent(ev *Event) error { ··· 120 121 } 121 122 122 123 evts, cancel, err := s.events.Subscribe(func(evt *Event) bool { 124 + for _, pid := range evt.relevantPds { 125 + if pid == peering.ID { 126 + return true 127 + } 128 + } 129 + 123 130 has, err := s.peerHasFollow(ctx, peering.ID, evt.uid) 124 131 if err != nil { 125 132 log.Println("error checking peer follow relationship: ", err) 126 133 return false 127 134 } 128 135 129 - fmt.Println("follow: ", has) 130 136 return has 131 137 }) 132 138 if err != nil {
+52 -6
server/federation_test.go
··· 175 175 } 176 176 } 177 177 178 - func (u *testUser) Post(t *testing.T, body string) string { 178 + func (u *testUser) Reply(t *testing.T, post, pcid, body string) string { 179 179 t.Helper() 180 180 181 181 ctx := context.TODO() ··· 185 185 Record: &bsky.FeedPost{ 186 186 CreatedAt: time.Now().Format(time.RFC3339), 187 187 Text: body, 188 + Reply: &bsky.FeedPost_ReplyRef{ 189 + Parent: &atproto.RepoStrongRef{ 190 + Cid: pcid, 191 + Uri: post, 192 + }, 193 + }, 188 194 }, 189 195 }) 190 196 ··· 194 200 195 201 return resp.Uri 196 202 } 203 + func (u *testUser) Post(t *testing.T, body string) *atproto.RepoStrongRef { 204 + t.Helper() 205 + 206 + ctx := context.TODO() 207 + resp, err := atproto.RepoCreateRecord(ctx, u.client, &atproto.RepoCreateRecord_Input{ 208 + Collection: "app.bsky.feed.post", 209 + Did: u.did, 210 + Record: &bsky.FeedPost{ 211 + CreatedAt: time.Now().Format(time.RFC3339), 212 + Text: body, 213 + }, 214 + }) 215 + 216 + if err != nil { 217 + t.Fatal(err) 218 + } 219 + 220 + return &atproto.RepoStrongRef{ 221 + Cid: resp.Cid, 222 + Uri: resp.Uri, 223 + } 224 + } 197 225 198 226 func (u *testUser) Follow(t *testing.T, did string) string { 199 227 t.Helper() ··· 230 258 return resp.Feed 231 259 } 232 260 261 + func (u *testUser) GetNotifs(t *testing.T) []*bsky.NotificationList_Notification { 262 + t.Helper() 263 + 264 + ctx := context.TODO() 265 + resp, err := bsky.NotificationList(ctx, u.client, "", 100) 266 + if err != nil { 267 + t.Fatal(err) 268 + } 269 + 270 + return resp.Notifications 271 + } 272 + 233 273 func testPLC(t *testing.T) *FakeDid { 234 274 // TODO: just do in memory... 235 275 tdir, err := ioutil.TempDir("", "plcserv") ··· 268 308 time.Sleep(time.Millisecond * 50) 269 309 270 310 f := bob.GetFeed(t) 271 - assert.Equal(f[0].Post.Uri, bp1) 272 - assert.Equal(f[1].Post.Uri, lp1) 311 + assert.Equal(f[0].Post.Uri, bp1.Uri) 312 + assert.Equal(f[1].Post.Uri, lp1.Uri) 273 313 274 314 lp2 := laura.Post(t, "im posting again!") 275 315 time.Sleep(time.Millisecond * 50) 276 316 277 317 f = bob.GetFeed(t) 278 - assert.Equal(f[0].Post.Uri, bp1) 279 - assert.Equal(f[1].Post.Uri, lp1) 280 - assert.Equal(f[2].Post.Uri, lp2) 318 + assert.Equal(f[0].Post.Uri, bp1.Uri) 319 + assert.Equal(f[1].Post.Uri, lp1.Uri) 320 + assert.Equal(f[2].Post.Uri, lp2.Uri) 321 + 322 + fmt.Println("laura notifications:") 323 + lnot := laura.GetNotifs(t) 324 + for _, n := range lnot { 325 + fmt.Println(n) 326 + } 281 327 282 328 select {} 283 329 }
+1
server/fedmgr.go
··· 76 76 return fmt.Errorf("failed to unmarshal event: %w", err) 77 77 } 78 78 79 + fmt.Println("got event: ", host.Host, ev.Kind, ev.Collection) 79 80 if err := s.handleFedEvent(context.TODO(), host, &ev); err != nil { 80 81 log.Printf("failed to index event from %q: %s", host.Host, err) 81 82 }
+49 -15
server/indexer.go
··· 69 69 Handle string 70 70 DisplayName string 71 71 Did string 72 - //Name string 73 - Following int64 74 - Followers int64 75 - Posts int64 76 - DeclRefCid string 77 - Type string 78 - PDS uint 72 + Following int64 73 + Followers int64 74 + Posts int64 75 + DeclRefCid string 76 + Type string 77 + PDS uint 79 78 } 80 79 81 80 type VoteDir int ··· 151 150 152 151 func (ix *Indexer) handleRecordCreate(ctx context.Context, evt *repomgr.RepoEvent, local bool) error { 153 152 fmt.Println("record create event", evt.Collection) 153 + var relevantPds []uint 154 154 switch rec := evt.Record.(type) { 155 155 case *bsky.FeedPost: 156 - fmt.Println("feed post") 157 156 var replyid uint 158 157 if rec.Reply != nil { 159 158 replyto, err := ix.GetPost(ctx, rec.Reply.Parent.Uri) ··· 178 177 return err 179 178 } 180 179 181 - return nil 182 180 case *bsky.FeedRepost: 183 181 fp, err := ix.GetPost(ctx, rec.Subject.Uri) 184 182 if err != nil { 185 183 return err 186 184 } 187 185 186 + author, err := ix.lookupUser(ctx, fp.Author) 187 + if err != nil { 188 + return err 189 + } 190 + 191 + relevantPds = append(relevantPds, author.PDS) 192 + 188 193 rr := RepostRecord{ 189 194 RecCreated: rec.CreatedAt, 190 195 Post: fp.ID, ··· 201 206 return err 202 207 } 203 208 204 - return nil 205 209 case *bsky.FeedVote: 206 210 var val int 207 211 var dbdir VoteDir ··· 226 230 return err 227 231 } 228 232 233 + relevantPds = append(relevantPds, act.PDS) 234 + 229 235 var post FeedPost 230 236 if err := ix.db.First(&post, "rkey = ? AND author = ?", puri.Rkey, act.Uid).Error; err != nil { 231 237 return err ··· 253 259 } 254 260 } 255 261 256 - return nil 257 262 case *bsky.GraphFollow: 258 263 subj, err := ix.lookupUserByDid(ctx, rec.Subject.Did) 259 264 if err != nil { ··· 269 274 if len(doc.Service) == 0 { 270 275 return fmt.Errorf("external followed user %s had no services in did document", rec.Subject.Did) 271 276 } 272 - 273 - fmt.Println("AKA: ", doc.AlsoKnownAs) 274 277 275 278 svc := doc.Service[0] 276 279 durl, err := url.Parse(svc.ServiceEndpoint) ··· 331 334 } 332 335 } 333 336 337 + if subj.PDS != 0 { 338 + relevantPds = append(relevantPds, subj.PDS) 339 + } 340 + 334 341 // 'follower' followed 'target' 335 342 fr := FollowRecord{ 336 343 Follower: evt.User, ··· 347 354 } 348 355 349 356 if local && subj.PDS != 0 { 350 - // technically don't need to send the same 'follow' multiple times 351 357 if err := ix.sendRemoteFollow(ctx, subj.Did, subj.PDS); err != nil { 352 358 log.Println("failed to issue remote follow directive: ", err) 353 359 } 354 360 } 355 361 356 - return nil 357 362 default: 358 363 return fmt.Errorf("unrecognized record type: %T", rec) 359 364 } 365 + 366 + did, err := ix.didForUser(ctx, evt.User) 367 + if err != nil { 368 + return err 369 + } 370 + 371 + fmt.Println("Sending event: ", evt.Collection, relevantPds) 372 + if err := ix.events.AddEvent(&Event{ 373 + CarSlice: evt.RepoSlice, 374 + Kind: EvtKindCreateRecord, 375 + uid: evt.User, 376 + User: did, 377 + Collection: evt.Collection, 378 + Rkey: evt.Rkey, 379 + relevantPds: relevantPds, 380 + }); err != nil { 381 + log.Println("failed to push event: ", err) 382 + } 383 + 384 + return nil 360 385 } 361 386 362 387 func (ix *Indexer) didForUser(ctx context.Context, uid uint) (string, error) { ··· 366 391 } 367 392 368 393 return ai.Did, nil 394 + } 395 + 396 + func (ix *Indexer) lookupUser(ctx context.Context, id uint) (*ActorInfo, error) { 397 + var ai ActorInfo 398 + if err := ix.db.First(&ai, "id = ?", id).Error; err != nil { 399 + return nil, err 400 + } 401 + 402 + return &ai, nil 369 403 } 370 404 371 405 func (ix *Indexer) lookupUserByDid(ctx context.Context, did string) (*ActorInfo, error) {
+11 -10
server/server.go
··· 5 5 "crypto/ecdsa" 6 6 "encoding/json" 7 7 "fmt" 8 - "log" 9 8 "net/mail" 10 9 "os" 11 10 "strings" ··· 91 90 repoman.SetEventHandler(func(ctx context.Context, evt *repomgr.RepoEvent) { 92 91 ix.HandleRepoEvent(ctx, evt) 93 92 94 - fe, err := s.repoEventToFedEvent(context.TODO(), evt) 95 - if err != nil { 96 - log.Println("event conversion error: ", err) 97 - return 98 - } 99 - if fe != nil { 100 - if err := evtman.AddEvent(fe); err != nil { 101 - log.Println("failed to push event: ", err) 93 + /* 94 + fe, err := s.repoEventToFedEvent(context.TODO(), evt) 95 + if err != nil { 96 + log.Println("event conversion error: ", err) 97 + return 102 98 } 103 - } 99 + if fe != nil { 100 + if err := evtman.AddEvent(fe); err != nil { 101 + log.Println("failed to push event: ", err) 102 + } 103 + } 104 + */ 104 105 }) 105 106 106 107 ix.sendRemoteFollow = s.sendRemoteFollow