shuffle useAccountIDIn check *before* adding to query

This commit is contained in:
kim 2024-04-12 15:42:32 +01:00
parent 05ccf89a4e
commit 0aff0bb196

View file

@ -421,16 +421,17 @@ func (a *accountDB) GetAccounts(
accountIDIn = append(accountIDIn, user.AccountID)
}
useAccountIDIn = true
} else if origin == "remote" {
// Get only remote accounts.
q = q.Where("? IS NOT NULL", bun.Ident("account.domain"))
} else if origin == "remote" {
if useAccountIDIn {
// useAccountIDIn specifically indicates
// a parameter that limits querying to
// local accounts, there will be none.
return nil, nil
}
// Get only remote accounts.
q = q.Where("? IS NOT NULL", bun.Ident("account.domain"))
}
if useAccountIDIn {