diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-09-27 08:22:36 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-27 08:22:36 +0800 |
commit | eb11ca68470e4ab60ed4ec31f4d170a4b36a528e (patch) | |
tree | 48347da8ba6c78d6ca30ac6ae5949fa93bb4c459 /models/pull.go | |
parent | d958b9db4fa0f1910b3ca82338e3d68a70efedd9 (diff) | |
download | gitea-eb11ca68470e4ab60ed4ec31f4d170a4b36a528e.tar.gz gitea-eb11ca68470e4ab60ed4ec31f4d170a4b36a528e.zip |
Extract actions on new pull request from models to pulls service and move code.gitea.io/gitea/modules/pull to code.gitea.io/gitea/services/pull (#8218)
* extract actions on new pull request from models to pulls service
* improve code
* move code.gitea.io/gitea/modules/pull to code.gitea.io/gitea/services/pull
* fix fmt
* Rename pulls.go to pull.go
Diffstat (limited to 'models/pull.go')
-rw-r--r-- | models/pull.go | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/models/pull.go b/models/pull.go index 2f7218f415..60ccb144f5 100644 --- a/models/pull.go +++ b/models/pull.go @@ -700,33 +700,6 @@ func NewPullRequest(repo *Repository, pull *Issue, labelIDs []int64, uuids []str return fmt.Errorf("Commit: %v", err) } - if err = NotifyWatchers(&Action{ - ActUserID: pull.Poster.ID, - ActUser: pull.Poster, - OpType: ActionCreatePullRequest, - Content: fmt.Sprintf("%d|%s", pull.Index, pull.Title), - RepoID: repo.ID, - Repo: repo, - IsPrivate: repo.IsPrivate, - }); err != nil { - log.Error("NotifyWatchers: %v", err) - } - - pr.Issue = pull - pull.PullRequest = pr - mode, _ := AccessLevel(pull.Poster, repo) - if err = PrepareWebhooks(repo, HookEventPullRequest, &api.PullRequestPayload{ - Action: api.HookIssueOpened, - Index: pull.Index, - PullRequest: pr.APIFormat(), - Repository: repo.APIFormat(mode), - Sender: pull.Poster.APIFormat(), - }); err != nil { - log.Error("PrepareWebhooks: %v", err) - } else { - go HookQueue.Add(repo.ID) - } - return nil } |