mirror of https://github.com/go-gitea/gitea.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.1 KiB
Go
37 lines
1.1 KiB
Go
4 months ago
|
// Copyright 2024 The Gitea Authors. All rights reserved.
|
||
|
// SPDX-License-Identifier: MIT
|
||
|
|
||
|
package pull
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
|
||
|
issues_model "code.gitea.io/gitea/models/issues"
|
||
|
user_model "code.gitea.io/gitea/models/user"
|
||
|
"code.gitea.io/gitea/modules/log"
|
||
|
notify_service "code.gitea.io/gitea/services/notify"
|
||
|
)
|
||
|
|
||
|
type pullNotifier struct {
|
||
|
notify_service.NullNotifier
|
||
|
}
|
||
|
|
||
|
var _ notify_service.Notifier = &pullNotifier{}
|
||
|
|
||
|
// NewNotifier create a new indexerNotifier notifier
|
||
|
func NewNotifier() notify_service.Notifier {
|
||
|
return &pullNotifier{}
|
||
|
}
|
||
|
|
||
|
func (r *pullNotifier) IssueChangeTitle(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, oldTitle string) {
|
||
|
var reviewNotifiers []*ReviewRequestNotifier
|
||
|
if issue.IsPull && issues_model.HasWorkInProgressPrefix(oldTitle) && !issues_model.HasWorkInProgressPrefix(issue.Title) {
|
||
|
var err error
|
||
|
reviewNotifiers, err = RequestCodeOwnersReview(ctx, issue, issue.PullRequest)
|
||
|
if err != nil {
|
||
|
log.Error("RequestCodeOwnersReview: %v", err)
|
||
|
}
|
||
|
}
|
||
|
ReviewRequestNotify(ctx, issue, issue.Poster, reviewNotifiers)
|
||
|
}
|