Remove redundant type cast for now

Signed-off-by: Alex Chen <minecnly@gmail.com>
This commit is contained in:
Cnly 2019-10-01 11:31:47 +08:00
parent 470ad737e4
commit 15508cfe0b

View file

@ -24,7 +24,6 @@ import (
"github.com/matrix-org/dendrite/common/config" "github.com/matrix-org/dendrite/common/config"
federationSenderAPI "github.com/matrix-org/dendrite/federationsender/api" federationSenderAPI "github.com/matrix-org/dendrite/federationsender/api"
roomserverAPI "github.com/matrix-org/dendrite/roomserver/api" roomserverAPI "github.com/matrix-org/dendrite/roomserver/api"
"github.com/matrix-org/gomatrix"
"github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/gomatrixserverlib"
"github.com/matrix-org/util" "github.com/matrix-org/util"
) )
@ -75,14 +74,9 @@ func DirectoryRoom(
if domain != cfg.Matrix.ServerName { if domain != cfg.Matrix.ServerName {
fedRes, fedErr := federation.LookupRoomAlias(req.Context(), domain, roomAlias) fedRes, fedErr := federation.LookupRoomAlias(req.Context(), domain, roomAlias)
if fedErr != nil { if fedErr != nil {
switch fedErr.(type) { // TODO: Return 502 if the remote server errored.
case gomatrix.HTTPError: // TODO: Return 504 if the remote server timed out.
// TODO: Return 502 if the remote server errored. return httputil.LogThenError(req, fedErr)
// TODO: Return 504 if the remote server timed out.
return httputil.LogThenError(req, fedErr)
default:
return httputil.LogThenError(req, fedErr)
}
} }
res.RoomID = fedRes.RoomID res.RoomID = fedRes.RoomID
res.fillServers(fedRes.Servers) res.fillServers(fedRes.Servers)