1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-10-05 19:30:58 +00:00
forgejo/services/federation/person_service.go

26 lines
665 B
Go
Raw Normal View History

// Copyright 2024 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package federation
import (
"context"
"forgejo.org/models/user"
"forgejo.org/modules/log"
ap "github.com/go-ap/activitypub"
)
func ProcessPersonInbox(ctx context.Context, user *user.User, activity *ap.Activity) (ServiceResult, error) {
switch activity.Type {
case ap.FollowType:
return processPersonFollow(ctx, user, activity)
case ap.UndoType:
return processPersonInboxUndo(ctx, user, activity)
}
log.Error("Unsupported PersonInbox activity: %v", activity.Type)
return ServiceResult{}, NewErrNotAcceptablef("unsupported activity: %v", activity.Type)
}