aboutsummaryrefslogtreecommitdiff
path: root/activitypub/activity.go
diff options
context:
space:
mode:
authorFChannel <>2022-06-12 15:36:19 -0700
committerFChannel <>2022-06-19 12:53:29 -0700
commitf57d5722e6f2187bea249240eb14c881f989c3c1 (patch)
treeef8f4d23f9c40e0b0ba1ab2efb03e3795efe8ec0 /activitypub/activity.go
parentdac4b267cab31fb3a4ce301f1bcdf364fcb541a1 (diff)
first pass on federation working
Diffstat (limited to 'activitypub/activity.go')
-rw-r--r--activitypub/activity.go14
1 files changed, 6 insertions, 8 deletions
diff --git a/activitypub/activity.go b/activitypub/activity.go
index 036a5ce..5d89272 100644
--- a/activitypub/activity.go
+++ b/activitypub/activity.go
@@ -23,7 +23,7 @@ func (activity Activity) AcceptFollow() Activity {
accept.Actor = &nActor
accept.Actor.Id = activity.Object.Actor
var nObj ObjectBase
- accept.Object = &nObj
+ accept.Object = nObj
accept.Object.Actor = activity.Actor.Id
var nNested NestedObjectBase
accept.Object.Object = &nNested
@@ -181,7 +181,7 @@ func (activity Activity) Reject() Activity {
accept.AtContext.Context = activity.AtContext.Context
accept.Type = "Reject"
var nObj ObjectBase
- accept.Object = &nObj
+ accept.Object = nObj
var nActor Actor
accept.Actor = &nActor
accept.Actor.Id = activity.Object.Actor
@@ -196,8 +196,8 @@ func (activity Activity) Reject() Activity {
}
func (activity Activity) Report(reason string) (bool, error) {
- if isLocal, err := activity.Object.IsLocal(); !isLocal || err != nil {
- return false, util.MakeError(err, "Report")
+ if isLocal, _ := activity.Object.IsLocal(); !isLocal {
+ return false, nil
}
reqActivity := Activity{Id: activity.Object.Id}
@@ -288,7 +288,7 @@ func (activity Activity) SetActorFollowing() (Activity, error) {
var query string
if alreadyFollowing && alreadyFollower {
- if res, err := activity.Actor.IsLocal(); err == nil && !res {
+ if res, _ := activity.Actor.IsLocal(); !res {
go activity.Actor.DeleteCache()
} else if err != nil {
return activity, util.MakeError(err, "SetActorFollowing")
@@ -306,10 +306,8 @@ func (activity Activity) SetActorFollowing() (Activity, error) {
}
if !alreadyFollowing && !alreadyFollower {
- if res, err := activity.Actor.IsLocal(); err == nil && !res {
+ if res, _ := activity.Actor.IsLocal(); !res {
go activity.Actor.WriteCache()
- } else if err != nil {
- return activity, util.MakeError(err, "SetActorFollowing")
}
query = `insert into following (id, following) values ($1, $2)`