From 452f393dd7de5203c5cd3ebe5697af6ea0f4b009 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Mon, 16 Mar 2020 16:05:29 +0000 Subject: Update room version descriptors, add error handling (#906) * Update room version descriptors, add error handling * Fix database queries * Drop Get from version package * Fix database wrapping, add comments for version descriptions * Don't set default room_version value in SQL --- roomserver/query/query.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'roomserver/query/query.go') diff --git a/roomserver/query/query.go b/roomserver/query/query.go index f138686b..83f89777 100644 --- a/roomserver/query/query.go +++ b/roomserver/query/query.go @@ -20,7 +20,6 @@ import ( "context" "encoding/json" "net/http" - "strconv" "github.com/matrix-org/dendrite/common" "github.com/matrix-org/dendrite/roomserver/api" @@ -733,10 +732,10 @@ func (r *RoomserverQueryAPI) QueryRoomVersionCapabilities( request *api.QueryRoomVersionCapabilitiesRequest, response *api.QueryRoomVersionCapabilitiesResponse, ) error { - response.DefaultRoomVersion = strconv.Itoa(int(version.GetDefaultRoomVersion())) + response.DefaultRoomVersion = string(version.DefaultRoomVersion()) response.AvailableRoomVersions = make(map[string]string) - for v, desc := range version.GetSupportedRoomVersions() { - sv := strconv.Itoa(int(v)) + for v, desc := range version.SupportedRoomVersions() { + sv := string(v) if desc.Stable { response.AvailableRoomVersions[sv] = "stable" } else { -- cgit v1.2.3