diff options
author | FChannel <> | 2021-07-25 17:35:41 -0700 |
---|---|---|
committer | FChannel <> | 2021-07-25 17:35:41 -0700 |
commit | 87fc54c9d41bdbe7eaa8769386776a3723580b34 (patch) | |
tree | 208bef1d292eb7aa58b44c7389bd9ed47b61d1fd /database.go | |
parent | 6846150cb48d080112981633d6dddabef5ce4439 (diff) |
showing post replies bug fix
Diffstat (limited to 'database.go')
-rw-r--r-- | database.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/database.go b/database.go index 3d3f9ff..db6a3d1 100644 --- a/database.go +++ b/database.go @@ -723,7 +723,7 @@ func GetObjectRepliesDBLimit(db *sql.DB, parent ObjectBase, limit int) (*Collect rows, err := db.Query(query, parent.Id, limit) - CheckError(err, "error with replies db query") + CheckError(err, "error with replies db query") var postCount int var attachCount int @@ -744,7 +744,8 @@ func GetObjectRepliesDBLimit(db *sql.DB, parent ObjectBase, limit int) (*Collect post.Actor = actor.Id var postCnt int - var imgCnt int + var imgCnt int + post.Replies, postCnt, imgCnt = GetObjectRepliesRepliesDB(db, post) post.Replies.TotalItems = postCnt @@ -794,7 +795,8 @@ func GetObjectRepliesDB(db *sql.DB, parent ObjectBase) (*CollectionBase, int, in post.Actor = actor.Id var postCnt int - var imgCnt int + var imgCnt int + post.Replies, postCnt, imgCnt = GetObjectRepliesRepliesDB(db, post) post.Replies.TotalItems = postCnt @@ -857,7 +859,7 @@ func GetObjectRepliesRepliesDB(db *sql.DB, parent ObjectBase) (*CollectionBase, query := `select count(x.id) over(), sum(case when RTRIM(x.attachment) = '' then 0 else 1 end) over(), x.id, x.name, x.content, x.type, x.published, x.attributedto, x.attachment, x.preview, x.actor, x.tripcode, x.sensitive from (select * from activitystream where id in (select id from replies where inreplyto=$1) and type='Note' union select * from cacheactivitystream where id in (select id from replies where inreplyto=$1) and type='Note') as x order by x.published asc` - rows, err := db.Query(query, parent.Id) + rows, err := db.Query(query, parent.Id) CheckError(err, "error with replies replies db query") |