mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 11:52:10 +00:00
Move notification interface to services layer (#26915)
Extract from #22266
This commit is contained in:
parent
084eacb5d4
commit
540bf9fa6d
51 changed files with 972 additions and 969 deletions
|
@ -14,9 +14,9 @@ import (
|
|||
repo_model "code.gitea.io/gitea/models/repo"
|
||||
user_model "code.gitea.io/gitea/models/user"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/notification"
|
||||
repo_module "code.gitea.io/gitea/modules/repository"
|
||||
"code.gitea.io/gitea/modules/sync"
|
||||
notify_service "code.gitea.io/gitea/services/notify"
|
||||
)
|
||||
|
||||
// repoWorkingPool represents a working pool to order the parallel changes to the same repository
|
||||
|
@ -54,7 +54,7 @@ func TransferOwnership(ctx context.Context, doer, newOwner *user_model.User, rep
|
|||
}
|
||||
}
|
||||
|
||||
notification.NotifyTransferRepository(ctx, doer, repo, oldOwner.Name)
|
||||
notify_service.TransferRepository(ctx, doer, repo, oldOwner.Name)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ func ChangeRepositoryName(ctx context.Context, doer *user_model.User, repo *repo
|
|||
repoWorkingPool.CheckOut(fmt.Sprint(repo.ID))
|
||||
|
||||
repo.Name = newRepoName
|
||||
notification.NotifyRenameRepository(ctx, doer, repo, oldRepoName)
|
||||
notify_service.RenameRepository(ctx, doer, repo, oldRepoName)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ func StartRepositoryTransfer(ctx context.Context, doer, newOwner *user_model.Use
|
|||
}
|
||||
|
||||
// notify users who are able to accept / reject transfer
|
||||
notification.NotifyRepoPendingTransfer(ctx, doer, newOwner, repo)
|
||||
notify_service.RepoPendingTransfer(ctx, doer, newOwner, repo)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue