Add Function description

This commit is contained in:
erik 2024-03-21 14:41:11 +01:00
parent 689837b63a
commit e4242dafd9

View file

@ -22,6 +22,13 @@ import (
"github.com/google/uuid"
)
// LikeActivity receives a ForgeLike activity and does the following:
// Validation of the activity
// Creation of a (remote) federationHost if not existing
// Creation of a forgefed Person if not existing
// Validation of incoming RepositoryID against Local RepositoryID
// Star the repo if it wasn't already stared
// Do some mitigation against out of order attacks
func LikeActivity(ctx *context.APIContext, form any, repositoryID int64) (int, string, error) {
activity := form.(*forgefed.ForgeLike)
if res, err := validation.IsValid(activity); !res {