mirror of
https://github.com/go-gitea/gitea
synced 2024-11-16 14:39:34 +01:00
Rename NotifyPullReviewRequest to NotifyPullRequestReviewRequest (#24988)
after #24481 To keep consistent, maybe pull_request_review_request is better. ## what my pull request does Rename NotifyPullReviewRequest to NotifyPullRequestReviewRequest. <img width="1087" alt="image" src="https://github.com/go-gitea/gitea/assets/75628309/2cf91f02-74f2-42fe-a998-0a039b821d8d">
This commit is contained in:
parent
bf27fc3596
commit
a5acec329e
@ -28,7 +28,7 @@ type Notifier interface {
|
|||||||
NotifyDeleteIssue(ctx context.Context, doer *user_model.User, issue *issues_model.Issue)
|
NotifyDeleteIssue(ctx context.Context, doer *user_model.User, issue *issues_model.Issue)
|
||||||
NotifyIssueChangeMilestone(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, oldMilestoneID int64)
|
NotifyIssueChangeMilestone(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, oldMilestoneID int64)
|
||||||
NotifyIssueChangeAssignee(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, assignee *user_model.User, removed bool, comment *issues_model.Comment)
|
NotifyIssueChangeAssignee(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, assignee *user_model.User, removed bool, comment *issues_model.Comment)
|
||||||
NotifyPullReviewRequest(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, reviewer *user_model.User, isRequest bool, comment *issues_model.Comment)
|
NotifyPullRequestReviewRequest(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, reviewer *user_model.User, isRequest bool, comment *issues_model.Comment)
|
||||||
NotifyIssueChangeContent(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, oldContent string)
|
NotifyIssueChangeContent(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, oldContent string)
|
||||||
NotifyIssueClearLabels(ctx context.Context, doer *user_model.User, issue *issues_model.Issue)
|
NotifyIssueClearLabels(ctx context.Context, doer *user_model.User, issue *issues_model.Issue)
|
||||||
NotifyIssueChangeTitle(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, oldTitle string)
|
NotifyIssueChangeTitle(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, oldTitle string)
|
||||||
|
@ -120,8 +120,8 @@ func (*NullNotifier) NotifyIssueChangeContent(ctx context.Context, doer *user_mo
|
|||||||
func (*NullNotifier) NotifyIssueChangeAssignee(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, assignee *user_model.User, removed bool, comment *issues_model.Comment) {
|
func (*NullNotifier) NotifyIssueChangeAssignee(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, assignee *user_model.User, removed bool, comment *issues_model.Comment) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NotifyPullReviewRequest places a place holder function
|
// NotifyPullRequestReviewRequest places a place holder function
|
||||||
func (*NullNotifier) NotifyPullReviewRequest(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, reviewer *user_model.User, isRequest bool, comment *issues_model.Comment) {
|
func (*NullNotifier) NotifyPullRequestReviewRequest(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, reviewer *user_model.User, isRequest bool, comment *issues_model.Comment) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NotifyIssueClearLabels places a place holder function
|
// NotifyIssueClearLabels places a place holder function
|
||||||
|
@ -123,7 +123,7 @@ func (m *mailNotifier) NotifyIssueChangeAssignee(ctx context.Context, doer *user
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *mailNotifier) NotifyPullReviewRequest(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, reviewer *user_model.User, isRequest bool, comment *issues_model.Comment) {
|
func (m *mailNotifier) NotifyPullRequestReviewRequest(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, reviewer *user_model.User, isRequest bool, comment *issues_model.Comment) {
|
||||||
if isRequest && doer.ID != reviewer.ID && reviewer.EmailNotifications() != user_model.EmailNotificationsDisabled {
|
if isRequest && doer.ID != reviewer.ID && reviewer.EmailNotifications() != user_model.EmailNotificationsDisabled {
|
||||||
ct := fmt.Sprintf("Requested to review %s.", issue.HTMLURL())
|
ct := fmt.Sprintf("Requested to review %s.", issue.HTMLURL())
|
||||||
if err := mailer.SendIssueAssignedMail(ctx, issue, doer, ct, comment, []*user_model.User{reviewer}); err != nil {
|
if err := mailer.SendIssueAssignedMail(ctx, issue, doer, ct, comment, []*user_model.User{reviewer}); err != nil {
|
||||||
|
@ -230,10 +230,10 @@ func NotifyIssueChangeAssignee(ctx context.Context, doer *user_model.User, issue
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// NotifyPullReviewRequest notifies Request Review change
|
// NotifyPullRequestReviewRequest notifies Request Review change
|
||||||
func NotifyPullReviewRequest(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, reviewer *user_model.User, isRequest bool, comment *issues_model.Comment) {
|
func NotifyPullRequestReviewRequest(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, reviewer *user_model.User, isRequest bool, comment *issues_model.Comment) {
|
||||||
for _, notifier := range notifiers {
|
for _, notifier := range notifiers {
|
||||||
notifier.NotifyPullReviewRequest(ctx, doer, issue, reviewer, isRequest, comment)
|
notifier.NotifyPullRequestReviewRequest(ctx, doer, issue, reviewer, isRequest, comment)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,7 +229,7 @@ func (ns *notificationService) NotifyIssueChangeAssignee(ctx context.Context, do
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ns *notificationService) NotifyPullReviewRequest(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, reviewer *user_model.User, isRequest bool, comment *issues_model.Comment) {
|
func (ns *notificationService) NotifyPullRequestReviewRequest(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, reviewer *user_model.User, isRequest bool, comment *issues_model.Comment) {
|
||||||
if isRequest {
|
if isRequest {
|
||||||
opts := issueNotificationOpts{
|
opts := issueNotificationOpts{
|
||||||
IssueID: issue.ID,
|
IssueID: issue.ID,
|
||||||
|
@ -73,7 +73,7 @@ func ReviewRequest(ctx context.Context, issue *issues_model.Issue, doer, reviewe
|
|||||||
}
|
}
|
||||||
|
|
||||||
if comment != nil {
|
if comment != nil {
|
||||||
notification.NotifyPullReviewRequest(ctx, doer, issue, reviewer, isAdd, comment)
|
notification.NotifyPullRequestReviewRequest(ctx, doer, issue, reviewer, isAdd, comment)
|
||||||
}
|
}
|
||||||
|
|
||||||
return comment, err
|
return comment, err
|
||||||
@ -260,7 +260,7 @@ func TeamReviewRequest(ctx context.Context, issue *issues_model.Issue, doer *use
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
comment.AssigneeID = member.ID
|
comment.AssigneeID = member.ID
|
||||||
notification.NotifyPullReviewRequest(ctx, doer, issue, member, isAdd, comment)
|
notification.NotifyPullRequestReviewRequest(ctx, doer, issue, member, isAdd, comment)
|
||||||
}
|
}
|
||||||
|
|
||||||
return comment, err
|
return comment, err
|
||||||
|
@ -719,9 +719,9 @@ func (m *webhookNotifier) NotifyPullRequestReview(ctx context.Context, pr *issue
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *webhookNotifier) NotifyPullReviewRequest(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, reviewer *user_model.User, isRequest bool, comment *issues_model.Comment) {
|
func (m *webhookNotifier) NotifyPullRequestReviewRequest(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, reviewer *user_model.User, isRequest bool, comment *issues_model.Comment) {
|
||||||
if !issue.IsPull {
|
if !issue.IsPull {
|
||||||
log.Warn("NotifyPullReviewRequest: issue is not a pull request: %v", issue.ID)
|
log.Warn("NotifyPullRequestReviewRequest: issue is not a pull request: %v", issue.ID)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
mode, _ := access_model.AccessLevelUnit(ctx, doer, issue.Repo, unit.TypePullRequests)
|
mode, _ := access_model.AccessLevelUnit(ctx, doer, issue.Repo, unit.TypePullRequests)
|
||||||
|
Loading…
Reference in New Issue
Block a user