Skip to content

Commit 27d30f1

Browse files
committed
Notifying on open PR, and Close/Reopen/Merge issue or PR
1 parent bb5a6b7 commit 27d30f1

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

routers/repo/issue.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,8 @@ func NewComment(ctx *context.Context, form auth.CreateCommentForm) {
875875
log.Error(4, "ChangeStatus: %v", err)
876876
} else {
877877
log.Trace("Issue [%d] status changed to closed: %v", issue.ID, issue.IsClosed)
878+
879+
notification.Service.NotifyIssue(issue, ctx.User.ID)
878880
}
879881
}
880882
}

routers/repo/pull.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ import (
1616
"code.gitea.io/gitea/modules/base"
1717
"code.gitea.io/gitea/modules/context"
1818
"code.gitea.io/gitea/modules/log"
19+
"code.gitea.io/gitea/modules/notification"
1920
"code.gitea.io/gitea/modules/setting"
21+
2022
"github.com/Unknwon/com"
2123
)
2224

@@ -415,6 +417,8 @@ func MergePullRequest(ctx *context.Context) {
415417
return
416418
}
417419

420+
notification.Service.NotifyIssue(pr.Issue, ctx.User.ID)
421+
418422
log.Trace("Pull request merged: %d", pr.ID)
419423
ctx.Redirect(ctx.Repo.RepoLink + "/pulls/" + com.ToStr(pr.Index))
420424
}
@@ -707,6 +711,8 @@ func CompareAndPullRequestPost(ctx *context.Context, form auth.CreateIssueForm)
707711
return
708712
}
709713

714+
notification.Service.NotifyIssue(pullIssue, ctx.User.ID)
715+
710716
log.Trace("Pull request created: %d/%d", repo.ID, pullIssue.ID)
711717
ctx.Redirect(ctx.Repo.RepoLink + "/pulls/" + com.ToStr(pullIssue.Index))
712718
}

0 commit comments

Comments
 (0)