···12 "github.com/bluesky-social/jetstream/pkg/client/schedulers/sequential"
13 "github.com/bluesky-social/jetstream/pkg/models"
14 "github.com/bugsnag/bugsnag-go"
15- "tangled.sh/tangled.sh/core/api/tangled"
16)
1718type Issue struct {
···199 createdAt = time.Now().UTC()
200 }
201202- // TODO: if there is a reply to present, don't store the comment because replies can't be replied to so
203 // the reply comment doesn't need to be stored
204-205- err = h.store.CreateComment(Comment{
206- AuthorDID: did,
207- RKey: rkey,
208- Body: comment.Body,
209- Issue: comment.Issue,
210- CreatedAt: createdAt.UnixMilli(),
211- //ReplyTo: comment, // TODO: there should be a ReplyTo field that can be used as well once the right type is imported
212- })
213- if err != nil {
214- bugsnag.Notify(err)
215- slog.Error("create comment", "error", err, "did", did, "rkey", rkey)
216- return
217 }
218219 // TODO: now send a notification to either the issue creator or whoever the comment was a reply to
···12 "github.com/bluesky-social/jetstream/pkg/client/schedulers/sequential"
13 "github.com/bluesky-social/jetstream/pkg/models"
14 "github.com/bugsnag/bugsnag-go"
15+ "tangled.org/core/api/tangled"
16)
1718type Issue struct {
···199 createdAt = time.Now().UTC()
200 }
201202+ // if there is a replyTo present, don't store the comment because replies can't be replied to so
203 // the reply comment doesn't need to be stored
204+ if comment.ReplyTo == nil || *comment.ReplyTo == "" {
205+ err = h.store.CreateComment(Comment{
206+ AuthorDID: did,
207+ RKey: rkey,
208+ Body: comment.Body,
209+ Issue: comment.Issue,
210+ CreatedAt: createdAt.UnixMilli(),
211+ })
212+ if err != nil {
213+ bugsnag.Notify(err)
214+ slog.Error("create comment", "error", err, "did", did, "rkey", rkey)
215+ return
216+ }
217 }
218219 // TODO: now send a notification to either the issue creator or whoever the comment was a reply to