this repo has no description
0
fork

Configure Feed

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

HACK: work around cborgen *bool support with just 'bool' on label.Neg

+16 -22
+11 -18
api/label/cbor_gen.go
··· 31 31 fieldCount-- 32 32 } 33 33 34 - if t.Neg == nil { 35 - fieldCount-- 36 - } 37 - 38 34 if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { 39 35 return err 40 36 } ··· 95 91 } 96 92 97 93 // t.Neg (bool) (bool) 98 - if t.Neg != nil { 94 + if len("neg") > cbg.MaxLength { 95 + return xerrors.Errorf("Value in field \"neg\" was too long") 96 + } 99 97 100 - if len("neg") > cbg.MaxLength { 101 - return xerrors.Errorf("Value in field \"neg\" was too long") 102 - } 98 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("neg"))); err != nil { 99 + return err 100 + } 101 + if _, err := io.WriteString(w, string("neg")); err != nil { 102 + return err 103 + } 103 104 104 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("neg"))); err != nil { 105 - return err 106 - } 107 - if _, err := io.WriteString(w, string("neg")); err != nil { 108 - return err 109 - } 110 - 111 - if err := cbg.WriteBool(w, t.Neg); err != nil { 112 - return err 113 - } 105 + if err := cbg.WriteBool(w, t.Neg); err != nil { 106 + return err 114 107 } 115 108 116 109 // t.Src (string) (string)
+5 -4
api/label/labellabel.go
··· 15 15 LexiconTypeID string `json:"$type,const=com.atproto.label.label" cborgen:"$type,const=com.atproto.label.label"` 16 16 Cid *string `json:"cid,omitempty" cborgen:"cid,omitempty"` 17 17 Cts string `json:"cts" cborgen:"cts"` 18 - Neg *bool `json:"neg,omitempty" cborgen:"neg,omitempty"` 19 - Src string `json:"src" cborgen:"src"` 20 - Uri string `json:"uri" cborgen:"uri"` 21 - Val string `json:"val" cborgen:"val"` 18 + // manually setting this to 'bool' not '*bool' 19 + Neg bool `json:"neg" cborgen:"neg"` 20 + Src string `json:"src" cborgen:"src"` 21 + Uri string `json:"uri" cborgen:"uri"` 22 + Val string `json:"val" cborgen:"val"` 22 23 }