Move Create() to activities.go

This commit is contained in:
Anthony Wang 2022-12-31 18:27:38 +00:00
parent be2a3375f3
commit 13b09cef50
No known key found for this signature in database
GPG Key ID: 42A5B952E6DD8D38
2 changed files with 10 additions and 19 deletions

View File

@ -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))},
}
}

View File

@ -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))},
}
}