summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-09-30 21:50:44 +0800
committerGitHub <noreply@github.com>2019-09-30 21:50:44 +0800
commite6113000c5cbbdbf10af7bda472fc8b254ec7605 (patch)
treee7b9fd86a4e7451083c298d29f09ecaaedf9970c /models
parenta5992d172551f7821e023cd3cbca1a7cc0b919ee (diff)
downloadgitea-e6113000c5cbbdbf10af7bda472fc8b254ec7605.tar.gz
gitea-e6113000c5cbbdbf10af7bda472fc8b254ec7605.zip
Extract actions on new issue from models to services (#8217)
* extract actions on new issue from models to services * improve code * rename services/issues to services/issue
Diffstat (limited to 'models')
-rw-r--r--models/issue.go25
1 files changed, 0 insertions, 25 deletions
diff --git a/models/issue.go b/models/issue.go
index 77712c0fec..da98fac7df 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -1225,31 +1225,6 @@ func NewIssue(repo *Repository, issue *Issue, labelIDs []int64, assigneeIDs []in
}
sess.Close()
- if err = NotifyWatchers(&Action{
- ActUserID: issue.Poster.ID,
- ActUser: issue.Poster,
- OpType: ActionCreateIssue,
- Content: fmt.Sprintf("%d|%s", issue.Index, issue.Title),
- RepoID: repo.ID,
- Repo: repo,
- IsPrivate: repo.IsPrivate,
- }); err != nil {
- log.Error("NotifyWatchers: %v", err)
- }
-
- mode, _ := AccessLevel(issue.Poster, issue.Repo)
- if err = PrepareWebhooks(repo, HookEventIssues, &api.IssuePayload{
- Action: api.HookIssueOpened,
- Index: issue.Index,
- Issue: issue.APIFormat(),
- Repository: repo.APIFormat(mode),
- Sender: issue.Poster.APIFormat(),
- }); err != nil {
- log.Error("PrepareWebhooks: %v", err)
- } else {
- go HookQueue.Add(issue.RepoID)
- }
-
return nil
}