@@ -373,10 +373,11 @@ func (s service) ListTimeline(ctx context.Context, rs string, id uint64, opt *ch PublishedAt githubv4.DateTime LastEditedAt *githubv4.DateTime Editor *githubV4Actor State githubv4.PullRequestReviewState Body string ReactionGroups reactionGroups ViewerCanUpdate bool Comments struct { Nodes []struct { DatabaseID uint64 Path string @@ -479,10 +480,11 @@ func (s service) ListTimeline(ctx context.Context, rs string, id uint64, opt *ch User: ghActor(review.Author), CreatedAt: review.PublishedAt.Time, Edited: edited, State: state, Body: review.Body, Reactions: ghReactions(review.ReactionGroups, ghUser(&q.Viewer)), Editable: review.ViewerCanUpdate, Comments: cs, }) } } @@ -673,10 +675,34 @@ func (s service) EditComment(ctx context.Context, rs string, id uint64, cr chang return change.Comment{}, err } subjectID = q.Node.IssueComment.ID viewerHasReacted = q.Node.IssueComment.Reactions.ViewerHasReacted viewer = ghUser(&q.Viewer) case strings.HasPrefix(cr.ID, "r"): reviewID := "017:PullRequestReview" + cr.ID[len("r"):] var q struct { Node struct { PullRequestReview struct { ID githubv4.ID Reactions struct { ViewerHasReacted bool } `graphql:"reactions(content:$reactionContent)"` } `graphql:"...on PullRequestReview"` } `graphql:"node(id:$reviewID)"` Viewer githubV4User } variables := map[string]interface{}{ "reviewID": githubv4.ID(base64.StdEncoding.EncodeToString([]byte(reviewID))), // HACK, TODO: Confirm StdEncoding vs URLEncoding. "reactionContent": reactionContent, } err = s.clV4.Query(ctx, &q, variables) if err != nil { return change.Comment{}, err } subjectID = q.Node.PullRequestReview.ID viewerHasReacted = q.Node.PullRequestReview.Reactions.ViewerHasReacted viewer = ghUser(&q.Viewer) case strings.HasPrefix(cr.ID, "rc"): commentID := "024:PullRequestReviewComment" + cr.ID[len("rc"):] var q struct { Node struct { PullRequestReviewComment struct {