summaryrefslogtreecommitdiffstats
path: root/models/action.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-11-15 16:06:11 +0800
committerGitHub <noreply@github.com>2019-11-15 16:06:11 +0800
commit21ae9838e04233bbf9930d368d935fd1f9b68c34 (patch)
tree610abb6f1ec2df235d469276b36f6d26e00e4653 /models/action.go
parentb30d744e0986dcf716d4f57dac8c72a494bb226b (diff)
downloadgitea-21ae9838e04233bbf9930d368d935fd1f9b68c34.tar.gz
gitea-21ae9838e04233bbf9930d368d935fd1f9b68c34.zip
Move transfer repository and rename repository on a service package and start action notification (#8573)
* move transfer repository and rename repository on a service package and start action notification * remove unused codes * fix lint * fix bugs * fix test * fix test * fix test * fix lint * update go mod and sum
Diffstat (limited to 'models/action.go')
-rw-r--r--models/action.go46
1 files changed, 0 insertions, 46 deletions
diff --git a/models/action.go b/models/action.go
index 3cd97eff09..1e05a68c39 100644
--- a/models/action.go
+++ b/models/action.go
@@ -522,52 +522,6 @@ func UpdateIssuesCommit(doer *User, repo *Repository, commits []*PushCommit, bra
return nil
}
-func transferRepoAction(e Engine, doer, oldOwner *User, repo *Repository) (err error) {
- if err = notifyWatchers(e, &Action{
- ActUserID: doer.ID,
- ActUser: doer,
- OpType: ActionTransferRepo,
- RepoID: repo.ID,
- Repo: repo,
- IsPrivate: repo.IsPrivate,
- Content: path.Join(oldOwner.Name, repo.Name),
- }); err != nil {
- return fmt.Errorf("notifyWatchers: %v", err)
- }
-
- // Remove watch for organization.
- if oldOwner.IsOrganization() {
- if err = watchRepo(e, oldOwner.ID, repo.ID, false); err != nil {
- return fmt.Errorf("watchRepo [false]: %v", err)
- }
- }
-
- return nil
-}
-
-// TransferRepoAction adds new action for transferring repository,
-// the Owner field of repository is assumed to be new owner.
-func TransferRepoAction(doer, oldOwner *User, repo *Repository) error {
- return transferRepoAction(x, doer, oldOwner, repo)
-}
-
-func mergePullRequestAction(e Engine, doer *User, repo *Repository, issue *Issue) error {
- return notifyWatchers(e, &Action{
- ActUserID: doer.ID,
- ActUser: doer,
- OpType: ActionMergePullRequest,
- Content: fmt.Sprintf("%d|%s", issue.Index, issue.Title),
- RepoID: repo.ID,
- Repo: repo,
- IsPrivate: repo.IsPrivate,
- })
-}
-
-// MergePullRequestAction adds new action for merging pull request.
-func MergePullRequestAction(actUser *User, repo *Repository, pull *Issue) error {
- return mergePullRequestAction(x, actUser, repo, pull)
-}
-
// GetFeedsOptions options for retrieving feeds
type GetFeedsOptions struct {
RequestedUser *User