mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-10-05 19:30:58 +00:00
26 lines
665 B
Go
26 lines
665 B
Go
|
// 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)
|
||
|
}
|