aboutsummaryrefslogtreecommitdiff
path: root/roomserver
diff options
context:
space:
mode:
authorTill <2353100+S7evinK@users.noreply.github.com>2023-04-03 21:42:46 +0200
committerGitHub <noreply@github.com>2023-04-03 21:42:46 +0200
commit682a7d0a66ce0dfd34cff2899daa6f16fdc7ebae (patch)
tree26329d399bb799aa6843521e65331167cf3e60ba /roomserver
parent560ba4627272b1ce5afc1f382871dd1967c836bc (diff)
Add tests for `/turnServer`, `/capabilities` and `/3pid/` (#3038)
Threepid seems to be pretty out of date, several missing endpoints. Should also fix #3037, where we were still listening on the `/unstable` prefix, while Element Web uses `/r0`
Diffstat (limited to 'roomserver')
-rw-r--r--roomserver/api/api.go1
-rw-r--r--roomserver/api/query.go9
-rw-r--r--roomserver/internal/query/query.go21
3 files changed, 1 insertions, 30 deletions
diff --git a/roomserver/api/api.go b/roomserver/api/api.go
index f6d003a4..dda5bb5a 100644
--- a/roomserver/api/api.go
+++ b/roomserver/api/api.go
@@ -144,7 +144,6 @@ type ClientRoomserverAPI interface {
QueryKnownUsers(ctx context.Context, req *QueryKnownUsersRequest, res *QueryKnownUsersResponse) error
QueryRoomVersionForRoom(ctx context.Context, req *QueryRoomVersionForRoomRequest, res *QueryRoomVersionForRoomResponse) error
QueryPublishedRooms(ctx context.Context, req *QueryPublishedRoomsRequest, res *QueryPublishedRoomsResponse) error
- QueryRoomVersionCapabilities(ctx context.Context, req *QueryRoomVersionCapabilitiesRequest, res *QueryRoomVersionCapabilitiesResponse) error
GetRoomIDForAlias(ctx context.Context, req *GetRoomIDForAliasRequest, res *GetRoomIDForAliasResponse) error
GetAliasesForRoomID(ctx context.Context, req *GetAliasesForRoomIDRequest, res *GetAliasesForRoomIDResponse) error
diff --git a/roomserver/api/query.go b/roomserver/api/query.go
index 24722db0..d60ec4f6 100644
--- a/roomserver/api/query.go
+++ b/roomserver/api/query.go
@@ -240,15 +240,6 @@ type QueryStateAndAuthChainResponse struct {
IsRejected bool `json:"is_rejected"`
}
-// QueryRoomVersionCapabilitiesRequest asks for the default room version
-type QueryRoomVersionCapabilitiesRequest struct{}
-
-// QueryRoomVersionCapabilitiesResponse is a response to QueryRoomVersionCapabilitiesRequest
-type QueryRoomVersionCapabilitiesResponse struct {
- DefaultRoomVersion gomatrixserverlib.RoomVersion `json:"default"`
- AvailableRoomVersions map[gomatrixserverlib.RoomVersion]string `json:"available"`
-}
-
// QueryRoomVersionForRoomRequest asks for the room version for a given room.
type QueryRoomVersionForRoomRequest struct {
RoomID string `json:"room_id"`
diff --git a/roomserver/internal/query/query.go b/roomserver/internal/query/query.go
index c5b74422..ce17580a 100644
--- a/roomserver/internal/query/query.go
+++ b/roomserver/internal/query/query.go
@@ -35,7 +35,6 @@ import (
"github.com/matrix-org/dendrite/roomserver/state"
"github.com/matrix-org/dendrite/roomserver/storage"
"github.com/matrix-org/dendrite/roomserver/types"
- "github.com/matrix-org/dendrite/roomserver/version"
)
type Queryer struct {
@@ -694,25 +693,7 @@ func GetAuthChain(
return authEvents, nil
}
-// QueryRoomVersionCapabilities implements api.RoomserverInternalAPI
-func (r *Queryer) QueryRoomVersionCapabilities(
- ctx context.Context,
- request *api.QueryRoomVersionCapabilitiesRequest,
- response *api.QueryRoomVersionCapabilitiesResponse,
-) error {
- response.DefaultRoomVersion = version.DefaultRoomVersion()
- response.AvailableRoomVersions = make(map[gomatrixserverlib.RoomVersion]string)
- for v, desc := range version.SupportedRoomVersions() {
- if desc.Stable {
- response.AvailableRoomVersions[v] = "stable"
- } else {
- response.AvailableRoomVersions[v] = "unstable"
- }
- }
- return nil
-}
-
-// QueryRoomVersionCapabilities implements api.RoomserverInternalAPI
+// QueryRoomVersionForRoom implements api.RoomserverInternalAPI
func (r *Queryer) QueryRoomVersionForRoom(
ctx context.Context,
request *api.QueryRoomVersionForRoomRequest,