fix public timeline bug (#150)

This commit is contained in:
tobi 2021-08-26 11:28:16 +02:00 committed by GitHub
commit ddc120d5e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 162 additions and 79 deletions

View file

@ -110,7 +110,7 @@ func (a *accountDB) GetInstanceAccount(ctx context.Context, domain string) (*gts
} else {
q = q.
Where("account.username = ?", domain).
Where("? IS NULL", bun.Ident("domain"))
WhereGroup(" AND ", whereEmptyOrNull("domain"))
}
err := processErrorResponse(q.Scan(ctx))
@ -172,7 +172,7 @@ func (a *accountDB) GetLocalAccountByUsername(ctx context.Context, username stri
q := a.newAccountQ(account).
Where("username = ?", username).
Where("? IS NULL", bun.Ident("domain"))
WhereGroup(" AND ", whereEmptyOrNull("domain"))
err := processErrorResponse(q.Scan(ctx))
@ -218,7 +218,7 @@ func (a *accountDB) GetAccountStatuses(ctx context.Context, accountID string, li
}
if excludeReplies {
q = q.Where("? IS NULL", bun.Ident("in_reply_to_id"))
q = q.WhereGroup(" AND ", whereEmptyOrNull("in_reply_to_id"))
}
if pinnedOnly {