diff options
Diffstat (limited to 'internal/db/bundb/account.go')
-rw-r--r-- | internal/db/bundb/account.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/internal/db/bundb/account.go b/internal/db/bundb/account.go index 95c3d80d8..f46143401 100644 --- a/internal/db/bundb/account.go +++ b/internal/db/bundb/account.go @@ -270,7 +270,14 @@ func (a *accountDB) GetAccountStatuses(ctx context.Context, accountID string, li } if excludeReplies { - q = q.WhereGroup(" AND ", whereEmptyOrNull("in_reply_to_id")) + // include self-replies (threads) + whereGroup := func(*bun.SelectQuery) *bun.SelectQuery { + return q. + WhereOr("in_reply_to_account_id = ?", accountID). + WhereGroup(" OR ", whereEmptyOrNull("in_reply_to_uri")) + } + + q = q.WhereGroup(" AND ", whereGroup) } if excludeReblogs { @@ -332,7 +339,7 @@ func (a *accountDB) GetAccountWebStatuses(ctx context.Context, accountID string, Table("statuses"). Column("id"). Where("account_id = ?", accountID). - WhereGroup(" AND ", whereEmptyOrNull("in_reply_to_id")). + WhereGroup(" AND ", whereEmptyOrNull("in_reply_to_uri")). WhereGroup(" AND ", whereEmptyOrNull("boost_of_id")). Where("visibility = ?", gtsmodel.VisibilityPublic). Where("federated = ?", true) |