diff --git a/consumer.go b/consumer.go index 8c6401f..0ca8e1a 100644 --- a/consumer.go +++ b/consumer.go @@ -12,7 +12,7 @@ import ( "github.com/bluesky-social/jetstream/pkg/client/schedulers/sequential" "github.com/bluesky-social/jetstream/pkg/models" "github.com/bugsnag/bugsnag-go" - "tangled.sh/tangled.sh/core/api/tangled" + "tangled.org/core/api/tangled" ) type Issue struct { @@ -199,21 +199,21 @@ func (h *Handler) handleCreateUpdateIssueCommentEvent(ctx context.Context, event createdAt = time.Now().UTC() } - // TODO: if there is a reply to present, don't store the comment because replies can't be replied to so + // if there is a replyTo present, don't store the comment because replies can't be replied to so // the reply comment doesn't need to be stored - - err = h.store.CreateComment(Comment{ - AuthorDID: did, - RKey: rkey, - Body: comment.Body, - Issue: comment.Issue, - CreatedAt: createdAt.UnixMilli(), - //ReplyTo: comment, // TODO: there should be a ReplyTo field that can be used as well once the right type is imported - }) - if err != nil { - bugsnag.Notify(err) - slog.Error("create comment", "error", err, "did", did, "rkey", rkey) - return + if comment.ReplyTo == nil || *comment.ReplyTo == "" { + err = h.store.CreateComment(Comment{ + AuthorDID: did, + RKey: rkey, + Body: comment.Body, + Issue: comment.Issue, + CreatedAt: createdAt.UnixMilli(), + }) + if err != nil { + bugsnag.Notify(err) + slog.Error("create comment", "error", err, "did", did, "rkey", rkey) + return + } } // TODO: now send a notification to either the issue creator or whoever the comment was a reply to diff --git a/go.mod b/go.mod index ea5d5c3..0010b7f 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/bugsnag/bugsnag-go v2.6.2+incompatible github.com/glebarez/go-sqlite v1.22.0 github.com/joho/godotenv v1.5.1 - tangled.sh/tangled.sh/core v1.8.1-alpha.0.20250828210137-07b009bd6b98 + tangled.org/core v1.9.0-alpha.0.20250924195920-24d79d05e4d2 ) require ( diff --git a/go.sum b/go.sum index b931ebe..691e8af 100644 --- a/go.sum +++ b/go.sum @@ -103,5 +103,7 @@ modernc.org/memory v1.7.2 h1:Klh90S215mmH8c9gO98QxQFsY+W451E8AnzjoE2ee1E= modernc.org/memory v1.7.2/go.mod h1:NO4NVCQy0N7ln+T9ngWqOQfi7ley4vpwvARR+Hjw95E= modernc.org/sqlite v1.28.0 h1:Zx+LyDDmXczNnEQdvPuEfcFVA2ZPyaD7UCZDjef3BHQ= modernc.org/sqlite v1.28.0/go.mod h1:Qxpazz0zH8Z1xCFyi5GSL3FzbtZ3fvbjmywNogldEW0= -tangled.sh/tangled.sh/core v1.8.1-alpha.0.20250828210137-07b009bd6b98 h1:WovrwwBufU89zoSaStoc6+qyUTEB/LxhUCM1MqGEUwU= -tangled.sh/tangled.sh/core v1.8.1-alpha.0.20250828210137-07b009bd6b98/go.mod h1:zXmPB9VMsPWpJ6Y51PWnzB1fL3w69P0IhR9rTXIfGPY= +tangled.org/core v1.9.0-alpha.0.20250924195920-24d79d05e4d2 h1:4bcQewZPzb7WfCuUPf4MPVWb04JiTbjbShcg5ONi9co= +tangled.org/core v1.9.0-alpha.0.20250924195920-24d79d05e4d2/go.mod h1:tYTB3RkgkeDAOFE0qX/9tQB80fdlDPR+vz4CdTMar3Y= +tangled.org/core v1.9.0-alpha.0.20250924200730-b2d8a54abc3d h1:DmdCyK+BZDYitJy6TdqTwvcci2EVYgDu2+LR853nyls= +tangled.org/core v1.9.0-alpha.0.20250924200730-b2d8a54abc3d/go.mod h1:tYTB3RkgkeDAOFE0qX/9tQB80fdlDPR+vz4CdTMar3Y=