aboutsummaryrefslogtreecommitdiff
path: root/roomserver/api
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2021-07-09 16:36:45 +0100
committerGitHub <noreply@github.com>2021-07-09 16:36:45 +0100
commitc8408a6387f6d155fe4e0547cbfdde7123832c84 (patch)
treedafecdf16214eefcb995e75734c60421eb6304e8 /roomserver/api
parent3e50bac9441ae43387fee510d5838039bc07e0bb (diff)
Add more optimised code path for checking if we're in a room (#1909)
* Add more optimised code path for checking if we're in a room * Fix database queries * Fix federation API test * Fix logging * Review comments * Make separate API call for room membership
Diffstat (limited to 'roomserver/api')
-rw-r--r--roomserver/api/query.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/roomserver/api/query.go b/roomserver/api/query.go
index af35f7e7..c70db65c 100644
--- a/roomserver/api/query.go
+++ b/roomserver/api/query.go
@@ -170,7 +170,8 @@ type QueryMembershipsForRoomResponse struct {
// QueryServerJoinedToRoomRequest is a request to QueryServerJoinedToRoom
type QueryServerJoinedToRoomRequest struct {
- // Server name of the server to find
+ // Server name of the server to find. If not specified, we will
+ // default to checking if the local server is joined.
ServerName gomatrixserverlib.ServerName `json:"server_name"`
// ID of the room to see if we are still joined to
RoomID string `json:"room_id"`
@@ -182,7 +183,8 @@ type QueryServerJoinedToRoomResponse struct {
RoomExists bool `json:"room_exists"`
// True if we still believe that we are participating in the room
IsInRoom bool `json:"is_in_room"`
- // List of servers that are also in the room
+ // List of servers that are also in the room. This will not be populated
+ // if the queried ServerName is the local server name.
ServerNames []gomatrixserverlib.ServerName `json:"server_names"`
}