summaryrefslogtreecommitdiffstats
path: root/modules/notification
diff options
context:
space:
mode:
authorOtto Richter (fnetX) <git@fralix.ovh>2022-03-01 01:20:15 +0100
committerGitHub <noreply@github.com>2022-03-01 01:20:15 +0100
commit062fd4c217cc7302f56acf043d6214a9db46ee2f (patch)
tree4aaa51baaee1d7ddfab00a88a2d22f5911af1312 /modules/notification
parent6859b6919800cbf2958dbfbe76fca42f4dcbb194 (diff)
downloadgitea-062fd4c217cc7302f56acf043d6214a9db46ee2f.tar.gz
gitea-062fd4c217cc7302f56acf043d6214a9db46ee2f.zip
[API] Allow removing issues (#18879)
Add new feature to delete issues and pulls via API Co-authored-by: fnetx <git@fralix.ovh> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Gusted <williamzijl7@hotmail.com> Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'modules/notification')
-rw-r--r--modules/notification/base/notifier.go1
-rw-r--r--modules/notification/base/null.go4
-rw-r--r--modules/notification/notification.go7
3 files changed, 12 insertions, 0 deletions
diff --git a/modules/notification/base/notifier.go b/modules/notification/base/notifier.go
index 7f5caa3bcc..8174741169 100644
--- a/modules/notification/base/notifier.go
+++ b/modules/notification/base/notifier.go
@@ -22,6 +22,7 @@ type Notifier interface {
NotifyTransferRepository(doer *user_model.User, repo *repo_model.Repository, oldOwnerName string)
NotifyNewIssue(issue *models.Issue, mentions []*user_model.User)
NotifyIssueChangeStatus(*user_model.User, *models.Issue, *models.Comment, bool)
+ NotifyDeleteIssue(*user_model.User, *models.Issue)
NotifyIssueChangeMilestone(doer *user_model.User, issue *models.Issue, oldMilestoneID int64)
NotifyIssueChangeAssignee(doer *user_model.User, issue *models.Issue, assignee *user_model.User, removed bool, comment *models.Comment)
NotifyPullReviewRequest(doer *user_model.User, issue *models.Issue, reviewer *user_model.User, isRequest bool, comment *models.Comment)
diff --git a/modules/notification/base/null.go b/modules/notification/base/null.go
index bd52b843a7..2bfcaafda9 100644
--- a/modules/notification/base/null.go
+++ b/modules/notification/base/null.go
@@ -33,6 +33,10 @@ func (*NullNotifier) NotifyNewIssue(issue *models.Issue, mentions []*user_model.
func (*NullNotifier) NotifyIssueChangeStatus(doer *user_model.User, issue *models.Issue, actionComment *models.Comment, isClosed bool) {
}
+// NotifyDeleteIssue notify when some issue deleted
+func (*NullNotifier) NotifyDeleteIssue(doer *user_model.User, issue *models.Issue) {
+}
+
// NotifyNewPullRequest places a place holder function
func (*NullNotifier) NotifyNewPullRequest(pr *models.PullRequest, mentions []*user_model.User) {
}
diff --git a/modules/notification/notification.go b/modules/notification/notification.go
index e8d5d07b34..a31e3810e2 100644
--- a/modules/notification/notification.go
+++ b/modules/notification/notification.go
@@ -60,6 +60,13 @@ func NotifyIssueChangeStatus(doer *user_model.User, issue *models.Issue, actionC
}
}
+// NotifyDeleteIssue notify when some issue deleted
+func NotifyDeleteIssue(doer *user_model.User, issue *models.Issue) {
+ for _, notifier := range notifiers {
+ notifier.NotifyDeleteIssue(doer, issue)
+ }
+}
+
// NotifyMergePullRequest notifies merge pull request to notifiers
func NotifyMergePullRequest(pr *models.PullRequest, doer *user_model.User) {
for _, notifier := range notifiers {