Add authorize_interaction case for Tickets

This commit is contained in:
Anthony Wang 2022-08-22 12:29:16 -05:00
parent c0efdedaa9
commit 73284dbf0b
No known key found for this signature in database
GPG Key ID: BC96B00AEC5F2D76
3 changed files with 11 additions and 2 deletions

View File

@ -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)

View File

@ -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
}

View File

@ -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