diff --git a/services/activitypub/activities.go b/services/activitypub/activities.go index 36d5eaf934..e9f10d4f1b 100644 --- a/services/activitypub/activities.go +++ b/services/activitypub/activities.go @@ -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))}, + } +} diff --git a/services/activitypub/create.go b/services/activitypub/create.go deleted file mode 100644 index 220e3d6fc7..0000000000 --- a/services/activitypub/create.go +++ /dev/null @@ -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))}, - } -}