aboutsummaryrefslogtreecommitdiff
path: root/Database.go
diff options
context:
space:
mode:
authorFChannel <=>2021-01-20 14:55:50 -0800
committerFChannel <=>2021-01-20 14:55:50 -0800
commitb6c03f8aa0ce125a76464699a72ff156769feb0e (patch)
tree1d270f5e81a823046cb0d7d9390b16787510b8b6 /Database.go
parent08fea42e13bd16b7f50ece10eebcbebe8c9509fb (diff)
added actor object to context json
Diffstat (limited to 'Database.go')
-rw-r--r--Database.go6
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")