diff options
author | FChannel <> | 2022-05-01 10:50:48 -0700 |
---|---|---|
committer | FChannel <> | 2022-06-19 12:53:29 -0700 |
commit | 2af4a39ac16c6245f0e87ddf3cc137339f6c604f (patch) | |
tree | cec86f25fd4bcd7cc1efd0bd01cfe8524b41c42c /activitypub/activity.go | |
parent | 503a6637b8294aeb8e5e5546f8acbd2b3d6c4744 (diff) |
creating new post and replying to post working
Diffstat (limited to 'activitypub/activity.go')
-rw-r--r-- | activitypub/activity.go | 17 |
1 files changed, 7 insertions, 10 deletions
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 |