mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[bugfix] Allow instance accounts to be shown in search results in certain circumstances (#2053)
This commit is contained in:
@@ -48,11 +48,12 @@ func (p *Processor) packageAccounts(
|
||||
ctx context.Context,
|
||||
requestingAccount *gtsmodel.Account,
|
||||
accounts []*gtsmodel.Account,
|
||||
includeInstanceAccounts bool,
|
||||
) ([]*apimodel.Account, gtserror.WithCode) {
|
||||
apiAccounts := make([]*apimodel.Account, 0, len(accounts))
|
||||
|
||||
for _, account := range accounts {
|
||||
if account.IsInstance() {
|
||||
if !includeInstanceAccounts && account.IsInstance() {
|
||||
// No need to show instance accounts.
|
||||
continue
|
||||
}
|
||||
@@ -169,8 +170,9 @@ func (p *Processor) packageSearchResult(
|
||||
statuses []*gtsmodel.Status,
|
||||
tags []*gtsmodel.Tag,
|
||||
v1 bool,
|
||||
includeInstanceAccounts bool,
|
||||
) (*apimodel.SearchResult, gtserror.WithCode) {
|
||||
apiAccounts, errWithCode := p.packageAccounts(ctx, requestingAccount, accounts)
|
||||
apiAccounts, errWithCode := p.packageAccounts(ctx, requestingAccount, accounts, includeInstanceAccounts)
|
||||
if errWithCode != nil {
|
||||
return nil, errWithCode
|
||||
}
|
||||
|
Reference in New Issue
Block a user