mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 10:12:26 -05:00
[bugfix] Account timeline: exclude self-replies that mention other accounts (#2670)
* Account timeline: exclude self-replies that mention other accounts * Add index for querying unmentioned statuses * remove now unused statuses_account_id_id_idx --------- Co-authored-by: tobi <tobi.smethurst@protonmail.com>
This commit is contained in:
parent
90dcc008c5
commit
ad28b9f166
4 changed files with 212 additions and 1 deletions
|
|
@ -604,13 +604,16 @@ func (a *accountDB) GetAccountStatuses(ctx context.Context, accountID string, li
|
|||
Where("? = ?", bun.Ident("status.account_id"), accountID)
|
||||
|
||||
if excludeReplies {
|
||||
q = q.WhereGroup(" AND ", func(*bun.SelectQuery) *bun.SelectQuery {
|
||||
q = q.WhereGroup(" AND ", func(q *bun.SelectQuery) *bun.SelectQuery {
|
||||
return q.
|
||||
// Do include self replies (threads), but
|
||||
// don't include replies to other people.
|
||||
Where("? = ?", bun.Ident("status.in_reply_to_account_id"), accountID).
|
||||
WhereOr("? IS NULL", bun.Ident("status.in_reply_to_uri"))
|
||||
})
|
||||
// Don't include replies that mention other people:
|
||||
// for example, an account's reply to its own reply to someone else.
|
||||
q = whereArrayIsNullOrEmpty(q, bun.Ident("status.mentions"))
|
||||
}
|
||||
|
||||
if excludeReblogs {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue