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/interface.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/interface.go')
-rw-r--r-- | syncapi/storage/interface.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/syncapi/storage/interface.go b/syncapi/storage/interface.go index 5a036d88..05542603 100644 --- a/syncapi/storage/interface.go +++ b/syncapi/storage/interface.go @@ -27,6 +27,8 @@ import ( type Database interface { Presence + SharedUsers + MaxStreamPositionForPDUs(ctx context.Context) (types.StreamPosition, error) MaxStreamPositionForReceipts(ctx context.Context) (types.StreamPosition, error) MaxStreamPositionForInvites(ctx context.Context) (types.StreamPosition, error) @@ -165,3 +167,8 @@ type Presence interface { PresenceAfter(ctx context.Context, after types.StreamPosition, filter gomatrixserverlib.EventFilter) (map[string]*types.PresenceInternal, error) MaxStreamPositionForPresence(ctx context.Context) (types.StreamPosition, error) } + +type SharedUsers interface { + // SharedUsers returns a subset of otherUserIDs that share a room with userID. + SharedUsers(ctx context.Context, userID string, otherUserIDs []string) ([]string, error) +} |