mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-29 12:42:46 +00:00
Optimise QueryServerJoinedToRoom (#1933)
* Optimise checking if a server is in a room * Fix queries * Fix queries
This commit is contained in:
parent
2f5e4f5991
commit
f0f8c7f055
7 changed files with 64 additions and 38 deletions
|
@ -1068,6 +1068,11 @@ func (d *Database) GetLocalServerInRoom(ctx context.Context, roomNID types.RoomN
|
|||
return d.MembershipTable.SelectLocalServerInRoom(ctx, roomNID)
|
||||
}
|
||||
|
||||
// GetServerInRoom returns true if we think a server is in a given room or false otherwise.
|
||||
func (d *Database) GetServerInRoom(ctx context.Context, roomNID types.RoomNID, serverName gomatrixserverlib.ServerName) (bool, error) {
|
||||
return d.MembershipTable.SelectServerInRoom(ctx, roomNID, serverName)
|
||||
}
|
||||
|
||||
// GetKnownUsers searches all users that userID knows about.
|
||||
func (d *Database) GetKnownUsers(ctx context.Context, userID, searchString string, limit int) ([]string, error) {
|
||||
stateKeyNID, err := d.EventStateKeysTable.SelectEventStateKeyNID(ctx, nil, userID)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue