aboutsummaryrefslogtreecommitdiff
path: root/activitypub
diff options
context:
space:
mode:
authorFChannel <>2022-05-01 10:50:48 -0700
committerFChannel <>2022-06-19 12:53:29 -0700
commit2af4a39ac16c6245f0e87ddf3cc137339f6c604f (patch)
treecec86f25fd4bcd7cc1efd0bd01cfe8524b41c42c /activitypub
parent503a6637b8294aeb8e5e5546f8acbd2b3d6c4744 (diff)
creating new post and replying to post working
Diffstat (limited to 'activitypub')
-rw-r--r--activitypub/activity.go17
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