mirror of
https://codeberg.org/forgejo/forgejo
synced 2024-11-25 11:16:11 +01:00
mv our actor code to forgefed
This commit is contained in:
parent
abdf56dde1
commit
1fe35e14a5
|
@ -1,7 +1,7 @@
|
||||||
// Copyright 2023 The forgejo Authors. All rights reserved.
|
// Copyright 2023 The forgejo Authors. All rights reserved.
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
package activitypub
|
package forgefed
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
@ -94,6 +94,7 @@ func (value PersonId) Validate() []string {
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Move valid-parts to valid package
|
||||||
/*
|
/*
|
||||||
IsValid concatenates the error messages with newlines and returns them if there are any
|
IsValid concatenates the error messages with newlines and returns them if there are any
|
||||||
*/
|
*/
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright 2023 The forgejo Authors. All rights reserved.
|
// Copyright 2023 The forgejo Authors. All rights reserved.
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
package activitypub
|
package forgefed
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
|
@ -11,7 +11,6 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"code.gitea.io/gitea/models/activitypub"
|
|
||||||
"code.gitea.io/gitea/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
"code.gitea.io/gitea/models/forgefed"
|
"code.gitea.io/gitea/models/forgefed"
|
||||||
repo_model "code.gitea.io/gitea/models/repo"
|
repo_model "code.gitea.io/gitea/models/repo"
|
||||||
|
@ -239,7 +238,7 @@ func RepositoryInbox(ctx *context.APIContext) {
|
||||||
log.Info("RepositoryInbox: Activity.Source: %v, Activity.Actor %v, Activity.Actor.Id %v", activity.Source, activity.Actor, activity.Actor.GetID().String())
|
log.Info("RepositoryInbox: Activity.Source: %v, Activity.Actor %v, Activity.Actor.Id %v", activity.Source, activity.Actor, activity.Actor.GetID().String())
|
||||||
|
|
||||||
// parse actorId
|
// parse actorId
|
||||||
actorId, err := activitypub.NewPersonId(activity.Actor.GetID().String(), string(activity.Source))
|
actorId, err := forgefed.NewPersonId(activity.Actor.GetID().String(), string(activity.Source))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.ServerError("Validate actorId", err)
|
ctx.ServerError("Validate actorId", err)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue