aboutsummaryrefslogtreecommitdiff
path: root/syncapi/storage/tables/interface.go
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-07-15 16:25:26 +0100
committerGitHub <noreply@github.com>2022-07-15 16:25:26 +0100
commit90bf01d8b107375d45aee9de79c1760a0363b189 (patch)
treee6220a07f788cbf27d9d13f10fd2d442b9b980f6 /syncapi/storage/tables/interface.go
parent69c86295f70b6756913df0bba37e30e0b3a6070e (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/tables/interface.go')
-rw-r--r--syncapi/storage/tables/interface.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/syncapi/storage/tables/interface.go b/syncapi/storage/tables/interface.go
index ccdebfdb..08568d9a 100644
--- a/syncapi/storage/tables/interface.go
+++ b/syncapi/storage/tables/interface.go
@@ -104,6 +104,8 @@ type CurrentRoomState interface {
SelectJoinedUsers(ctx context.Context) (map[string][]string, error)
// SelectJoinedUsersInRoom returns a map of room ID to a list of joined user IDs for a given room.
SelectJoinedUsersInRoom(ctx context.Context, roomIDs []string) (map[string][]string, error)
+ // SelectSharedUsers returns a subset of otherUserIDs that share a room with userID.
+ SelectSharedUsers(ctx context.Context, txn *sql.Tx, userID string, otherUserIDs []string) ([]string, error)
}
// BackwardsExtremities keeps track of backwards extremities for a room.