aboutsummaryrefslogtreecommitdiff
path: root/activitypub/object.go
diff options
context:
space:
mode:
authorFChannel <>2022-06-12 16:20:59 -0700
committerFChannel <>2022-06-19 12:53:29 -0700
commit0418dab57f9cf19540234d157a512e30a70a7152 (patch)
treee01656aa763eb33ca1114de95d9fde61db175af1 /activitypub/object.go
parentf57d5722e6f2187bea249240eb14c881f989c3c1 (diff)
error with getting object sets actor to empty
Diffstat (limited to 'activitypub/object.go')
-rw-r--r--activitypub/object.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/activitypub/object.go b/activitypub/object.go
index e26514d..74fc136 100644
--- a/activitypub/object.go
+++ b/activitypub/object.go
@@ -290,6 +290,7 @@ func (obj ObjectBase) DeleteRequest() error {
if err != nil {
return util.MakeError(err, "DeleteRequest")
}
+
for _, e := range following {
activity.To = append(activity.To, e.Id)
}
@@ -427,7 +428,7 @@ func (obj ObjectBase) GetCollectionFromPath() (Collection, error) {
query := `select x.id, x.name, x.content, x.type, x.published, x.updated, x.attributedto, x.attachment, x.preview, x.actor, x.tripcode, x.sensitive from (select id, name, content, type, published, updated, attributedto, attachment, preview, actor, tripcode, sensitive from activitystream where id like $1 and (type='Note' or type='Archive') union select id, name, content, type, published, updated, attributedto, attachment, preview, actor, tripcode, sensitive from cacheactivitystream where id like $1 and (type='Note' or type='Archive')) as x order by x.updated`
if err = config.DB.QueryRow(query, obj.Id).Scan(&post.Id, &post.Name, &post.Content, &post.Type, &post.Published, &post.Updated, &post.AttributedTo, &post.Attachment[0].Id, &post.Preview.Id, &actor.Id, &post.TripCode, &post.Sensitive); err != nil {
- return nColl, util.MakeError(err, "GetCollectionFromPath")
+ return nColl, nil
}
post.Actor = actor.Id
@@ -475,9 +476,6 @@ func (obj ObjectBase) GetFromPath() (ObjectBase, error) {
return post, util.MakeError(err, "GetFromPath")
}
- var nActor Actor
- post.Actor = nActor.Id
-
var postCnt int
var imgCnt int
@@ -977,13 +975,11 @@ func (obj ObjectBase) _Tombstone() error {
datetime := time.Now().UTC().Format(time.RFC3339)
query := `update activitystream set type='Tombstone', name='', content='', attributedto='deleted', tripcode='', deleted=$1 where id=$2`
-
if _, err := config.DB.Exec(query, datetime, obj.Id); err != nil {
return util.MakeError(err, "_Tombstone")
}
query = `update cacheactivitystream set type='Tombstone', name='', content='', attributedto='deleted', tripcode='', deleted=$1 where id=$2`
-
_, err := config.DB.Exec(query, datetime, obj.Id)
return util.MakeError(err, "_Tombstone")
}