this repo has no description
0
fork

Configure Feed

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

a few small bgs fixes, auth, make gosky build

+16 -5
+5
cmd/bgs/main.go
··· 90 90 return err 91 91 } 92 92 93 + db.AutoMigrate(User{}) 94 + db.AutoMigrate(PDS{}) 95 + 93 96 if cctx.Bool("dbtracing") { 94 97 if err := db.Use(tracing.NewPlugin()); err != nil { 95 98 return err ··· 111 114 112 115 evtman := events.NewEventManager() 113 116 117 + // not necessary to generate notifications, should probably make the 118 + // indexer just take optional callbacks for notification stuff 114 119 notifman := notifs.NewNotificationManager(db, repoman.GetRecord) 115 120 116 121 didr := &api.PLCServer{Host: cctx.String("plc")}
+3 -3
cmd/gosky/main.go
··· 308 308 309 309 func prettyPrintPost(p *apibsky.FeedFeedViewPost) { 310 310 fmt.Println(strings.Repeat("-", 60)) 311 - rec := p.Post.Record.(map[string]any) 312 - fmt.Printf("%s (%s):\n", p.Post.Author.Handle, rec["createdAt"]) 313 - fmt.Println(rec["text"]) 311 + rec := p.Post.Record.Val.(*apibsky.FeedPost) 312 + fmt.Printf("%s (%s):\n", p.Post.Author.Handle, rec.CreatedAt) 313 + fmt.Println(rec.Text) 314 314 } 315 315 316 316 var feedGetCmd = &cli.Command{
+8 -2
server/server.go
··· 644 644 ctx := c.Request().Context() 645 645 646 646 var peering Peering 647 - if err := s.db.First(&peering, "did = ?", did).Error; err != nil { 648 - return err 647 + if did != "" { 648 + if err := s.db.First(&peering, "did = ?", did).Error; err != nil { 649 + return err 650 + } 649 651 } 650 652 651 653 evts, cancel, err := s.events.Subscribe(func(evt *events.Event) bool { 654 + if peering.ID == 0 { 655 + return true 656 + } 657 + 652 658 for _, pid := range evt.PrivRelevantPds { 653 659 if pid == peering.ID { 654 660 return true