aboutsummaryrefslogtreecommitdiff
path: root/roomserver/internal/query
diff options
context:
space:
mode:
authorTill <2353100+S7evinK@users.noreply.github.com>2022-08-12 13:33:31 +0200
committerGitHub <noreply@github.com>2022-08-12 13:33:31 +0200
commitb4647fbb7e36014c01d4ec8a65e2644133103683 (patch)
tree23b91f2dd900006ee6ccdf7849e59886d01781ff /roomserver/internal/query
parent48600d554096d54d12a6d3834f8f5f45506e3026 (diff)
Show/hide users in user directory (#2637)
* CS API changes * Query remote profiles * Add passing tests * Don't create a new FullyQualifiedProfile * Handle sql.ErrNoRows Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
Diffstat (limited to 'roomserver/internal/query')
-rw-r--r--roomserver/internal/query/query.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/roomserver/internal/query/query.go b/roomserver/internal/query/query.go
index c41e1ea6..f3061c22 100644
--- a/roomserver/internal/query/query.go
+++ b/roomserver/internal/query/query.go
@@ -21,6 +21,10 @@ import (
"errors"
"fmt"
+ "github.com/matrix-org/gomatrixserverlib"
+ "github.com/matrix-org/util"
+ "github.com/sirupsen/logrus"
+
"github.com/matrix-org/dendrite/clientapi/auth/authtypes"
"github.com/matrix-org/dendrite/internal/caching"
"github.com/matrix-org/dendrite/roomserver/acls"
@@ -30,9 +34,6 @@ import (
"github.com/matrix-org/dendrite/roomserver/storage"
"github.com/matrix-org/dendrite/roomserver/types"
"github.com/matrix-org/dendrite/roomserver/version"
- "github.com/matrix-org/gomatrixserverlib"
- "github.com/matrix-org/util"
- "github.com/sirupsen/logrus"
)
type Queryer struct {
@@ -732,7 +733,7 @@ func (r *Queryer) QueryRoomsForUser(ctx context.Context, req *api.QueryRoomsForU
func (r *Queryer) QueryKnownUsers(ctx context.Context, req *api.QueryKnownUsersRequest, res *api.QueryKnownUsersResponse) error {
users, err := r.DB.GetKnownUsers(ctx, req.UserID, req.SearchString, req.Limit)
- if err != nil {
+ if err != nil && err != sql.ErrNoRows {
return err
}
for _, user := range users {