This repository has no description
0

Configure Feed

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

core / appview / pulls / state.go
871 B 36 lines
1package pulls 2 3import ( 4 "net/http" 5 "time" 6 7 comatproto "github.com/bluesky-social/indigo/api/atproto" 8 "github.com/bluesky-social/indigo/atproto/syntax" 9 lexutil "github.com/bluesky-social/indigo/lex/util" 10 11 "tangled.org/core/api/tangled" 12 "tangled.org/core/appview/models" 13 "tangled.org/core/tid" 14) 15 16func (s *Pulls) writePullStatusRecord(r *http.Request, actorDid string, subject syntax.ATURI, value models.StateValue) error { 17 client, err := s.oauth.AuthorizedClient(r) 18 if err != nil { 19 return err 20 } 21 22 record, err := models.AsPullStatusRecord(subject, value, time.Now()) 23 if err != nil { 24 return err 25 } 26 27 _, err = comatproto.RepoPutRecord(r.Context(), client, &comatproto.RepoPutRecord_Input{ 28 Collection: tangled.RepoPullStatusNSID, 29 Repo: actorDid, 30 Rkey: tid.TID(), 31 Record: &lexutil.LexiconTypeDecoder{ 32 Val: &record, 33 }, 34 }) 35 return err 36}