From 0b97866be3a15f64170673af9813b39cbc585db5 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Sat, 4 Jun 2022 15:12:24 -0700 Subject: archive page works --- activitypub/object.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activitypub') diff --git a/activitypub/object.go b/activitypub/object.go index 4682832..891cb23 100644 --- a/activitypub/object.go +++ b/activitypub/object.go @@ -425,7 +425,7 @@ func (obj ObjectBase) GetCollectionFromPath() (Collection, error) { var err 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' union select id, name, content, type, published, updated, attributedto, attachment, preview, actor, tripcode, sensitive from cacheactivitystream where id like $1 and type='Note') as x order by x.updated` + 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") } @@ -663,7 +663,7 @@ func (obj ObjectBase) GetRepliesReplies() (CollectionBase, int, int, error) { var err error var rows *sql.Rows - 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` + 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' or type='Archive') union select * from cacheactivitystream where id in (select id from replies where inreplyto=$1) and (type='Note' or type='Archive')) as x order by x.published asc` if rows, err = config.DB.Query(query, obj.Id); err != nil { return nColl, postCount, attachCount, util.MakeError(err, "GetRepliesReplies") } -- cgit v1.2.3