Move Create() to activities.go
This commit is contained in:
parent
be2a3375f3
commit
13b09cef50
|
@ -50,3 +50,13 @@ func Unstar(user *user_model.User, repo *repo_model.Repository) *ap.Undo {
|
|||
To: ap.ItemCollection{ap.IRI(repo.GetIRI() + "/inbox")},
|
||||
}
|
||||
}
|
||||
|
||||
// Create Create activity
|
||||
func Create(user *user_model.User, object ap.ObjectOrLink, to string) *ap.Create {
|
||||
return &ap.Create{
|
||||
Type: ap.CreateType,
|
||||
Actor: ap.IRI(user.GetIRI()),
|
||||
Object: object,
|
||||
To: ap.ItemCollection{ap.Item(ap.IRI(to))},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
// Copyright 2022 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package activitypub
|
||||
|
||||
import (
|
||||
user_model "code.gitea.io/gitea/models/user"
|
||||
|
||||
ap "github.com/go-ap/activitypub"
|
||||
)
|
||||
|
||||
func Create(user *user_model.User, object ap.ObjectOrLink, to string) *ap.Create {
|
||||
return &ap.Create{
|
||||
Type: ap.CreateType,
|
||||
Actor: ap.IRI(user.GetIRI()),
|
||||
Object: object,
|
||||
To: ap.ItemCollection{ap.Item(ap.IRI(to))},
|
||||
}
|
||||
}
|
Reference in a new issue