mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 10:48:37 +00:00
Add transfer repository
This commit is contained in:
@@ -21,6 +21,7 @@ const (
|
||||
OP_COMMIT_REPO
|
||||
OP_CREATE_ISSUE
|
||||
OP_PULL_REQUEST
|
||||
OP_TRANSFER_REPO
|
||||
)
|
||||
|
||||
// Action represents user operation type and other information to repository.,
|
||||
@@ -108,6 +109,18 @@ func NewRepoAction(user *User, repo *Repository) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
// TransferRepoAction adds new action for transfering repository.
|
||||
func TransferRepoAction(user, newUser *User, repo *Repository) (err error) {
|
||||
if err = NotifyWatchers(&Action{ActUserId: user.Id, ActUserName: user.Name, ActEmail: user.Email,
|
||||
OpType: OP_TRANSFER_REPO, RepoId: repo.Id, RepoName: repo.Name, Content: newUser.Name}); err != nil {
|
||||
log.Error("action.TransferRepoAction(notify watchers): %d/%s", user.Id, repo.Name)
|
||||
return err
|
||||
}
|
||||
|
||||
log.Trace("action.TransferRepoAction: %s/%s", user.LowerName, repo.LowerName)
|
||||
return err
|
||||
}
|
||||
|
||||
// GetFeeds returns action list of given user in given context.
|
||||
func GetFeeds(userid, offset int64, isProfile bool) ([]Action, error) {
|
||||
actions := make([]Action, 0, 20)
|
||||
|
Reference in New Issue
Block a user