Add authorize_interaction case for Tickets
parent
c0efdedaa9
commit
73284dbf0b
|
@ -65,6 +65,15 @@ func AuthorizeInteraction(ctx *context.Context) {
|
|||
return
|
||||
}
|
||||
ctx.Redirect(username + "/" + reponame)
|
||||
case forgefed.TicketType:
|
||||
err = forgefed.OnTicket(object, func(t *forgefed.Ticket) error {
|
||||
return ReceiveIssue(ctx, t)
|
||||
})
|
||||
if err != nil {
|
||||
ctx.ServerError("ReceiveIssue", err)
|
||||
return
|
||||
}
|
||||
// TODO: Implement ticketIRIToName and redirect to ticket
|
||||
}
|
||||
|
||||
ctx.Status(http.StatusOK)
|
||||
|
|
|
@ -11,7 +11,7 @@ import (
|
|||
)
|
||||
|
||||
// Create an issue
|
||||
func Issue(ctx context.Context, ticket *forgefed.Ticket) error {
|
||||
func ReceiveIssue(ctx context.Context, ticket *forgefed.Ticket) error {
|
||||
// TODO
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -136,7 +136,7 @@ func RepoInbox(ctx *context.APIContext) {
|
|||
return activitypub.PullRequest(ctx, t)
|
||||
}
|
||||
// New issue
|
||||
return activitypub.Issue(ctx, t)
|
||||
return activitypub.ReceiveIssue(ctx, t)
|
||||
})
|
||||
case ap.NoteType:
|
||||
// New comment
|
||||
|
|
Loading…
Reference in New Issue