From 13b09cef50b1fcd4b2103f52dd548c8c8a9bd40c Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Sat, 31 Dec 2022 18:27:38 +0000 Subject: [PATCH] Move Create() to activities.go --- services/activitypub/activities.go | 10 ++++++++++ services/activitypub/create.go | 19 ------------------- 2 files changed, 10 insertions(+), 19 deletions(-) delete mode 100644 services/activitypub/create.go 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))}, - } -}