forked from tangled.org/core
this repo has no description

rework comment lexicon to add reply_to

Signed-off-by: oppiliappan <me@oppi.li>

oppi.li d7569292 11713b90

verified
Changed files
+26 -84
api
lexicons
issue
+16 -73
api/tangled/cbor_gen.go
··· 5898 5898 } 5899 5899 5900 5900 cw := cbg.NewCborWriter(w) 5901 - fieldCount := 6 5902 - 5903 - if t.Owner == nil { 5904 - fieldCount-- 5905 - } 5901 + fieldCount := 5 5906 5902 5907 - if t.Repo == nil { 5903 + if t.ReplyTo == nil { 5908 5904 fieldCount-- 5909 5905 } 5910 5906 ··· 5935 5931 return err 5936 5932 } 5937 5933 5938 - // t.Repo (string) (string) 5939 - if t.Repo != nil { 5940 - 5941 - if len("repo") > 1000000 { 5942 - return xerrors.Errorf("Value in field \"repo\" was too long") 5943 - } 5944 - 5945 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil { 5946 - return err 5947 - } 5948 - if _, err := cw.WriteString(string("repo")); err != nil { 5949 - return err 5950 - } 5951 - 5952 - if t.Repo == nil { 5953 - if _, err := cw.Write(cbg.CborNull); err != nil { 5954 - return err 5955 - } 5956 - } else { 5957 - if len(*t.Repo) > 1000000 { 5958 - return xerrors.Errorf("Value in field t.Repo was too long") 5959 - } 5960 - 5961 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Repo))); err != nil { 5962 - return err 5963 - } 5964 - if _, err := cw.WriteString(string(*t.Repo)); err != nil { 5965 - return err 5966 - } 5967 - } 5968 - } 5969 - 5970 5934 // t.LexiconTypeID (string) (string) 5971 5935 if len("$type") > 1000000 { 5972 5936 return xerrors.Errorf("Value in field \"$type\" was too long") ··· 6009 5973 return err 6010 5974 } 6011 5975 6012 - // t.Owner (string) (string) 6013 - if t.Owner != nil { 5976 + // t.ReplyTo (string) (string) 5977 + if t.ReplyTo != nil { 6014 5978 6015 - if len("owner") > 1000000 { 6016 - return xerrors.Errorf("Value in field \"owner\" was too long") 5979 + if len("replyTo") > 1000000 { 5980 + return xerrors.Errorf("Value in field \"replyTo\" was too long") 6017 5981 } 6018 5982 6019 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("owner"))); err != nil { 5983 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("replyTo"))); err != nil { 6020 5984 return err 6021 5985 } 6022 - if _, err := cw.WriteString(string("owner")); err != nil { 5986 + if _, err := cw.WriteString(string("replyTo")); err != nil { 6023 5987 return err 6024 5988 } 6025 5989 6026 - if t.Owner == nil { 5990 + if t.ReplyTo == nil { 6027 5991 if _, err := cw.Write(cbg.CborNull); err != nil { 6028 5992 return err 6029 5993 } 6030 5994 } else { 6031 - if len(*t.Owner) > 1000000 { 6032 - return xerrors.Errorf("Value in field t.Owner was too long") 5995 + if len(*t.ReplyTo) > 1000000 { 5996 + return xerrors.Errorf("Value in field t.ReplyTo was too long") 6033 5997 } 6034 5998 6035 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Owner))); err != nil { 5999 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.ReplyTo))); err != nil { 6036 6000 return err 6037 6001 } 6038 - if _, err := cw.WriteString(string(*t.Owner)); err != nil { 6002 + if _, err := cw.WriteString(string(*t.ReplyTo)); err != nil { 6039 6003 return err 6040 6004 } 6041 6005 } ··· 6118 6082 6119 6083 t.Body = string(sval) 6120 6084 } 6121 - // t.Repo (string) (string) 6122 - case "repo": 6123 - 6124 - { 6125 - b, err := cr.ReadByte() 6126 - if err != nil { 6127 - return err 6128 - } 6129 - if b != cbg.CborNull[0] { 6130 - if err := cr.UnreadByte(); err != nil { 6131 - return err 6132 - } 6133 - 6134 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 6135 - if err != nil { 6136 - return err 6137 - } 6138 - 6139 - t.Repo = (*string)(&sval) 6140 - } 6141 - } 6142 6085 // t.LexiconTypeID (string) (string) 6143 6086 case "$type": 6144 6087 ··· 6161 6104 6162 6105 t.Issue = string(sval) 6163 6106 } 6164 - // t.Owner (string) (string) 6165 - case "owner": 6107 + // t.ReplyTo (string) (string) 6108 + case "replyTo": 6166 6109 6167 6110 { 6168 6111 b, err := cr.ReadByte() ··· 6179 6122 return err 6180 6123 } 6181 6124 6182 - t.Owner = (*string)(&sval) 6125 + t.ReplyTo = (*string)(&sval) 6183 6126 } 6184 6127 } 6185 6128 // t.CreatedAt (string) (string)
+1 -2
api/tangled/issuecomment.go
··· 21 21 Body string `json:"body" cborgen:"body"` 22 22 CreatedAt string `json:"createdAt" cborgen:"createdAt"` 23 23 Issue string `json:"issue" cborgen:"issue"` 24 - Owner *string `json:"owner,omitempty" cborgen:"owner,omitempty"` 25 - Repo *string `json:"repo,omitempty" cborgen:"repo,omitempty"` 24 + ReplyTo *string `json:"replyTo,omitempty" cborgen:"replyTo,omitempty"` 26 25 }
+9 -9
lexicons/issue/comment.json
··· 9 9 "key": "tid", 10 10 "record": { 11 11 "type": "object", 12 - "required": ["issue", "body", "createdAt"], 12 + "required": [ 13 + "issue", 14 + "body", 15 + "createdAt" 16 + ], 13 17 "properties": { 14 18 "issue": { 15 19 "type": "string", 16 20 "format": "at-uri" 17 21 }, 18 - "repo": { 19 - "type": "string", 20 - "format": "at-uri" 21 - }, 22 - "owner": { 23 - "type": "string", 24 - "format": "did" 25 - }, 26 22 "body": { 27 23 "type": "string" 28 24 }, 29 25 "createdAt": { 30 26 "type": "string", 31 27 "format": "datetime" 28 + }, 29 + "replyTo": { 30 + "type": "string", 31 + "format": "at-uri" 32 32 } 33 33 } 34 34 }