summaryrefslogtreecommitdiff
path: root/internal/processing/search/util.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-08-02 09:31:09 +0200
committerLibravatar GitHub <noreply@github.com>2023-08-02 08:31:09 +0100
commitcec29e2a8d2d6ca49bb6c789f0ed3226849a7359 (patch)
tree042ba1ddd9d42552403b3a00e224e45e498b962a /internal/processing/search/util.go
parent[feature] Allow users to skip http client tls verification for testing purpos... (diff)
downloadgotosocial-cec29e2a8d2d6ca49bb6c789f0ed3226849a7359.tar.xz
[bugfix] Allow instance accounts to be shown in search results in certain circumstances (#2053)
Diffstat (limited to 'internal/processing/search/util.go')
-rw-r--r--internal/processing/search/util.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/processing/search/util.go b/internal/processing/search/util.go
index 171d0e570..c0eac0ca3 100644
--- a/internal/processing/search/util.go
+++ b/internal/processing/search/util.go
@@ -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
}