diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2020-07-28 10:53:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-28 10:53:17 +0100 |
commit | acc8e80a51515c953c6710cb24f36fd9d1f7aeb1 (patch) | |
tree | b33ecfd8e4d7ed3ac7aa66226f8fd80c1cdcf649 /userapi/storage/accounts/postgres/storage.go | |
parent | c63286713570e1274759db971b15405665fa391a (diff) |
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
Diffstat (limited to 'userapi/storage/accounts/postgres/storage.go')
-rw-r--r-- | userapi/storage/accounts/postgres/storage.go | 7 |
1 files changed, 7 insertions, 0 deletions
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) +} |