@@ -286,10 +286,26 @@ func (s service) ListTimeline(ctx context.Context, rs string, id uint64, opt *ch
ReactionGroups reactionGroups
ViewerCanUpdate bool
} `graphql:"...on IssueComment"`
ClosedEvent struct {
event
Closer struct {
Typename string `graphql:"__typename"`
PullRequest struct {
State githubql.PullRequestState
Title string
URL string
} `graphql:"...on PullRequest"`
Commit struct {
OID string
Message string
Author struct {
AvatarURL string `graphql:"avatarUrl(size:96)"`
}
URL string
} `graphql:"...on Commit"`
}
} `graphql:"...on ClosedEvent"`
ReopenedEvent struct {
event
} `graphql:"...on ReopenedEvent"`
RenamedTitleEvent struct {
@@ -460,11 +476,33 @@ func (s service) ListTimeline(ctx context.Context, rs string, id uint64, opt *ch
}
switch event.Typename {
case "ClosedEvent":
e.Actor = ghActor(event.ClosedEvent.Actor)
e.CreatedAt = event.ClosedEvent.CreatedAt.Time
e.Payload = change.ClosedEvent{}
switch event.ClosedEvent.Closer.Typename {
case "PullRequest":
pr := event.ClosedEvent.Closer.PullRequest
e.Payload = change.ClosedEvent{
Closer: change.Change{
State: ghPRState(pr.State),
Title: pr.Title,
},
CloserHTMLURL: pr.URL,
}
case "Commit":
c := event.ClosedEvent.Closer.Commit
e.Payload = change.ClosedEvent{
Closer: change.Commit{
SHA: c.OID,
Message: c.Message,
Author: users.User{AvatarURL: c.Author.AvatarURL},
},
CloserHTMLURL: c.URL,
}
default:
e.Payload = change.ClosedEvent{}
}
case "ReopenedEvent":
e.Actor = ghActor(event.ReopenedEvent.Actor)
e.CreatedAt = event.ReopenedEvent.CreatedAt.Time
e.Payload = change.ReopenedEvent{}
case "RenamedTitleEvent":