From 2af4a39ac16c6245f0e87ddf3cc137339f6c604f Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Sun, 1 May 2022 10:50:48 -0700 Subject: creating new post and replying to post working --- activitypub/activity.go | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'activitypub') diff --git a/activitypub/activity.go b/activitypub/activity.go index aef060b..22c9f06 100644 --- a/activitypub/activity.go +++ b/activitypub/activity.go @@ -243,26 +243,23 @@ func HasContextFromJson(context []byte) (bool, error) { } func IsActivityLocal(activity Activity) (bool, error) { + for _, e := range activity.To { - if res, err := GetActorFromDB(e); err == nil && res.Id != "" { + if res, _ := GetActorFromDB(e); res.Id != "" { return true, nil - } else if err != nil { - return false, err } } for _, e := range activity.Cc { - if res, err := GetActorFromDB(e); err == nil && res.Id != "" { + if res, _ := GetActorFromDB(e); res.Id != "" { return true, nil - } else if err != nil { - return false, err } } - if res, err := GetActorFromDB(activity.Actor.Id); err == nil && activity.Actor != nil && res.Id != "" { - return true, nil - } else if err != nil { - return false, err + if activity.Actor != nil { + if res, _ := GetActorFromDB(activity.Actor.Id); res.Id != "" { + return true, nil + } } return false, nil -- cgit v1.2.3