From b6c03f8aa0ce125a76464699a72ff156769feb0e Mon Sep 17 00:00:00 2001 From: FChannel <=> Date: Wed, 20 Jan 2021 14:55:50 -0800 Subject: added actor object to context json --- Database.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Database.go') 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") -- cgit v1.2.3