diff options
author | FChannel <=> | 2021-01-20 14:55:50 -0800 |
---|---|---|
committer | FChannel <=> | 2021-01-20 14:55:50 -0800 |
commit | b6c03f8aa0ce125a76464699a72ff156769feb0e (patch) | |
tree | 1d270f5e81a823046cb0d7d9390b16787510b8b6 /Database.go | |
parent | 08fea42e13bd16b7f50ece10eebcbebe8c9509fb (diff) |
added actor object to context json
Diffstat (limited to 'Database.go')
-rw-r--r-- | Database.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Database.go b/Database.go index d0f6892..f79bf50 100644 --- a/Database.go +++ b/Database.go @@ -290,8 +290,11 @@ func WritePreviewToDB(db *sql.DB, obj NestedObjectBase) { func GetActivityFromDB(db *sql.DB, id string) Collection { var nColl Collection + var nActor Actor var result []ObjectBase + nColl.Actor = &nActor + query := `select actor, id, name, content, type, published, updated, attributedto, attachment, preview, actor from activitystream where id=$1 order by updated asc` rows, err := db.Query(query, id) @@ -305,7 +308,8 @@ func GetActivityFromDB(db *sql.DB, id string) Collection { var attachID string var previewID string - err = rows.Scan(&nColl.Actor, &post.Id, &post.Name, &post.Content, &post.Type, &post.Published, &post.Updated, &post.AttributedTo, &attachID, &previewID, &actor.Id) + + err = rows.Scan(&nColl.Actor.Id, &post.Id, &post.Name, &post.Content, &post.Type, &post.Published, &post.Updated, &post.AttributedTo, &attachID, &previewID, &actor.Id) CheckError(err, "error scan object into post struct") |