diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2022-07-15 16:25:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-15 16:25:26 +0100 |
commit | 90bf01d8b107375d45aee9de79c1760a0363b189 (patch) | |
tree | e6220a07f788cbf27d9d13f10fd2d442b9b980f6 /syncapi/storage/shared/syncserver.go | |
parent | 69c86295f70b6756913df0bba37e30e0b3a6070e (diff) |
Use sync API database in `filterSharedUsers` (#2572)
* Add function to the sync API storage package for filtering shared users
* Use the database instead of asking the RS API
* Fix unit tests
* Fix map handling in `filterSharedUsers`
Diffstat (limited to 'syncapi/storage/shared/syncserver.go')
-rw-r--r-- | syncapi/storage/shared/syncserver.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/syncapi/storage/shared/syncserver.go b/syncapi/storage/shared/syncserver.go index 76114aff..d1c5e2d1 100644 --- a/syncapi/storage/shared/syncserver.go +++ b/syncapi/storage/shared/syncserver.go @@ -176,6 +176,10 @@ func (d *Database) AllPeekingDevicesInRooms(ctx context.Context) (map[string][]t return d.Peeks.SelectPeekingDevices(ctx) } +func (d *Database) SharedUsers(ctx context.Context, userID string, otherUserIDs []string) ([]string, error) { + return d.CurrentRoomState.SelectSharedUsers(ctx, nil, userID, otherUserIDs) +} + func (d *Database) GetStateEvent( ctx context.Context, roomID, evType, stateKey string, ) (*gomatrixserverlib.HeaderedEvent, error) { |