From acc8e80a51515c953c6710cb24f36fd9d1f7aeb1 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Tue, 28 Jul 2020 10:53:17 +0100 Subject: User directory (#1225) * User directory * Fix syncapi unit test * Make user directory only show remote users you know about from your joined rooms * Update sytest-whitelist * Review comments --- userapi/storage/accounts/postgres/storage.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'userapi/storage/accounts/postgres/storage.go') diff --git a/userapi/storage/accounts/postgres/storage.go b/userapi/storage/accounts/postgres/storage.go index c76b92f1..f56fb6d8 100644 --- a/userapi/storage/accounts/postgres/storage.go +++ b/userapi/storage/accounts/postgres/storage.go @@ -298,3 +298,10 @@ func (d *Database) GetAccountByLocalpart(ctx context.Context, localpart string, ) (*api.Account, error) { return d.accounts.selectAccountByLocalpart(ctx, localpart) } + +// SearchProfiles returns all profiles where the provided localpart or display name +// match any part of the profiles in the database. +func (d *Database) SearchProfiles(ctx context.Context, searchString string, limit int, +) ([]authtypes.Profile, error) { + return d.profiles.selectProfilesBySearch(ctx, searchString, limit) +} -- cgit v1.2.3