this repo has no description
0
fork

Configure Feed

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

another round of lex refactors

+57 -26
+1 -1
bgs/bgs.go
··· 435 435 436 436 if peering.ID == 0 { 437 437 438 - cfg, err := atproto.ServerGetAccountsConfig(ctx, c) 438 + cfg, err := atproto.ServerDescribeServer(ctx, c) 439 439 if err != nil { 440 440 // TODO: failing this shouldnt halt our indexing 441 441 return nil, fmt.Errorf("failed to check unrecognized pds: %w", err)
+2 -2
cmd/gosky/main.go
··· 578 578 } 579 579 580 580 return comatproto.RepoDeleteRecord(context.TODO(), xrpcc, &comatproto.RepoDeleteRecord_Input{ 581 - Did: xrpcc.Auth.Did, 581 + Repo: xrpcc.Auth.Did, 582 582 Collection: schema, 583 583 Rkey: rkey, 584 584 }) ··· 838 838 839 839 handle := cctx.Args().Get(0) 840 840 841 - err = comatproto.HandleUpdate(ctx, xrpcc, &comatproto.HandleUpdate_Input{ 841 + err = comatproto.IdentityUpdateHandle(ctx, xrpcc, &comatproto.IdentityUpdateHandle_Input{ 842 842 Handle: handle, 843 843 }) 844 844 if err != nil {
+1 -1
cmd/stress/main.go
··· 95 95 invite = &inv 96 96 } 97 97 98 - cfg, err := comatproto.ServerGetAccountsConfig(ctx, xrpcc) 98 + cfg, err := comatproto.ServerDescribeServer(ctx, xrpcc) 99 99 if err != nil { 100 100 return err 101 101 }
+11 -2
models/models.go
··· 48 48 PDS uint 49 49 } 50 50 51 - func (ai *ActorInfo) ActorRef() *bsky.ActorDefs_WithInfo { 52 - return &bsky.ActorDefs_WithInfo{ 51 + func (ai *ActorInfo) ActorRef() *bsky.ActorDefs_ProfileViewBasic { 52 + return &bsky.ActorDefs_ProfileViewBasic{ 53 + Did: ai.Did, 54 + Handle: ai.Handle, 55 + DisplayName: &ai.DisplayName, 56 + } 57 + } 58 + 59 + // TODO: this is just s stub; needs to populate more info 60 + func (ai *ActorInfo) ActorView() *bsky.ActorDefs_ProfileView { 61 + return &bsky.ActorDefs_ProfileView{ 53 62 Did: ai.Did, 54 63 Handle: ai.Handle, 55 64 DisplayName: &ai.DisplayName,
+5 -5
notifs/notifs.go
··· 75 75 IndexedAt time.Time 76 76 Uri string 77 77 Cid string 78 - Author *appbskytypes.ActorDefs_WithInfo 78 + Author *appbskytypes.ActorDefs_ProfileViewBasic 79 79 Reason string 80 80 ReasonSubject *string 81 81 } ··· 180 180 IndexedAt: nrec.CreatedAt.Format(time.RFC3339), 181 181 Uri: "at://" + voter.Did + "/app.bsky.feed.vote/" + vote.Rkey, 182 182 Cid: vote.Cid, 183 - Author: voter.ActorRef(), 183 + Author: voter.ActorView(), 184 184 Reason: "vote", 185 185 ReasonSubject: &rsub, 186 186 }, nil ··· 220 220 IndexedAt: nrec.CreatedAt.Format(time.RFC3339), 221 221 Uri: "at://" + reposter.Did + "/app.bsky.feed.repost/" + repost.Rkey, 222 222 Cid: repost.RecCid, 223 - Author: reposter.ActorRef(), 223 + Author: reposter.ActorView(), 224 224 Reason: "repost", 225 225 ReasonSubject: &rsub, 226 226 }, nil ··· 260 260 IndexedAt: nrec.CreatedAt.Format(time.RFC3339), 261 261 Uri: "at://" + author.Did + "/app.bsky.feed.post/" + fp.Rkey, 262 262 Cid: fp.Cid, 263 - Author: author.ActorRef(), 263 + Author: author.ActorView(), 264 264 Reason: "reply", 265 265 ReasonSubject: &rsub, 266 266 }, nil ··· 288 288 IndexedAt: nrec.CreatedAt.Format(time.RFC3339), 289 289 Uri: "at://" + follower.Did + "/app.bsky.graph.follow/" + frec.Rkey, 290 290 Cid: frec.Cid, 291 - Author: follower.ActorRef(), 291 + Author: follower.ActorView(), 292 292 Reason: "follow", 293 293 }, nil 294 294
+7 -7
pds/feedgen.go
··· 37 37 /* 38 38 type HydratedFeedItem struct { 39 39 Uri string 40 - RepostedBy *bsky.ActorDefs_WithInfo 40 + RepostedBy *bsky.ActorDefs_ProfileViewBasic 41 41 Record any 42 42 ReplyCount int64 43 43 RepostCount int64 ··· 45 45 DownvoteCount int64 46 46 MyState *bsky.FeedGetAuthorFeed_MyState 47 47 Cid string 48 - Author *bsky.ActorDefs_WithInfo 49 - TrendedBy *bsky.ActorDefs_WithInfo 48 + Author *bsky.ActorDefs_ProfileViewBasic 49 + TrendedBy *bsky.ActorDefs_ProfileViewBasic 50 50 Embed *bsky.FeedEmbed 51 51 IndexedAt string 52 52 } ··· 104 104 return ai.Did, nil 105 105 } 106 106 107 - func (fg *FeedGenerator) getActorRefInfo(ctx context.Context, user bsutil.Uid) (*bsky.ActorDefs_WithInfo, error) { 107 + func (fg *FeedGenerator) getActorRefInfo(ctx context.Context, user bsutil.Uid) (*bsky.ActorDefs_ProfileViewBasic, error) { 108 108 // TODO: cache the shit out of this too 109 109 var ai models.ActorInfo 110 110 if err := fg.db.First(&ai, "uid = ?", user).Error; err != nil { ··· 333 333 } 334 334 335 335 type HydratedVote struct { 336 - Actor *bsky.ActorDefs_WithInfo 336 + Actor *bsky.ActorDefs_ProfileViewBasic 337 337 Direction string 338 338 IndexedAt time.Time 339 339 CreatedAt string ··· 385 385 } 386 386 387 387 type FollowInfo struct { 388 - Follower *bsky.ActorDefs_WithInfo 389 - Subject *bsky.ActorDefs_WithInfo 388 + Follower *bsky.ActorDefs_ProfileViewBasic 389 + Subject *bsky.ActorDefs_ProfileViewBasic 390 390 CreatedAt string 391 391 IndexedAt string 392 392 }
+1 -1
pds/server.go
··· 352 352 return true 353 353 case "/xrpc/com.atproto.server.createAccount": 354 354 return true 355 - case "/xrpc/com.atproto.server.getAccountsConfig": 355 + case "/xrpc/com.atproto.server.describeServer": 356 356 return true 357 357 case "/xrpc/app.bsky.actor.getProfile": 358 358 fmt.Println("TODO: currently not requiring auth on get profile endpoint")
+22
pds/type_helpers.go
··· 1 + package pds 2 + 3 + import ( 4 + "context" 5 + 6 + appbsky "github.com/bluesky-social/indigo/api/bsky" 7 + ) 8 + 9 + // TODO: this is a quick helper to transform bsky.ActorDefs_ProfileViewBasic to 10 + // bsky.ActorDefs_ProfileView, written during the lexicon refactor (March 11 + // 2023). It probably needs to be updated to actually populate all the 12 + // additional fields (eg, via additional database queries) 13 + func (s *Server) actorBasicToView(ctx context.Context, basic *appbsky.ActorDefs_ProfileViewBasic) *appbsky.ActorDefs_ProfileView { 14 + view := &appbsky.ActorDefs_ProfileView{ 15 + Avatar: basic.Avatar, 16 + Did: basic.Did, 17 + DisplayName: basic.DisplayName, 18 + Handle: basic.Handle, 19 + Viewer: basic.Viewer, 20 + } 21 + return view 22 + }
+7 -7
repomgr/repomgr.go
··· 667 667 return repo.NextTID() 668 668 } 669 669 670 - func (rm *RepoManager) BatchWrite(ctx context.Context, user util.Uid, writes []*atproto.RepoBatchWrite_Input_Writes_Elem) error { 670 + func (rm *RepoManager) BatchWrite(ctx context.Context, user util.Uid, writes []*atproto.RepoApplyWrites_Input_Writes_Elem) error { 671 671 ctx, span := otel.Tracer("repoman").Start(ctx, "BatchWrite") 672 672 defer span.End() 673 673 ··· 692 692 var ops []RepoOp 693 693 for _, w := range writes { 694 694 switch { 695 - case w.RepoBatchWrite_Create != nil: 696 - c := w.RepoBatchWrite_Create 695 + case w.RepoApplyWrites_Create != nil: 696 + c := w.RepoApplyWrites_Create 697 697 var rkey string 698 698 if c.Rkey != nil { 699 699 rkey = *c.Rkey ··· 714 714 RecCid: &cc, 715 715 Record: c.Value.Val, 716 716 }) 717 - case w.RepoBatchWrite_Update != nil: 718 - u := w.RepoBatchWrite_Update 717 + case w.RepoApplyWrites_Update != nil: 718 + u := w.RepoApplyWrites_Update 719 719 720 720 cc, err := r.PutRecord(ctx, u.Collection+"/"+u.Rkey, u.Value.Val) 721 721 if err != nil { ··· 729 729 RecCid: &cc, 730 730 Record: u.Value.Val, 731 731 }) 732 - case w.RepoBatchWrite_Delete != nil: 733 - d := w.RepoBatchWrite_Delete 732 + case w.RepoApplyWrites_Delete != nil: 733 + d := w.RepoApplyWrites_Delete 734 734 735 735 if err := r.DeleteRecord(ctx, d.Collection+"/"+d.Rkey); err != nil { 736 736 return err