diff options
Diffstat (limited to 'roomserver/internal/alias.go')
-rw-r--r-- | roomserver/internal/alias.go | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/roomserver/internal/alias.go b/roomserver/internal/alias.go index 97b2ddf5..843b0bcc 100644 --- a/roomserver/internal/alias.go +++ b/roomserver/internal/alias.go @@ -23,6 +23,8 @@ import ( "github.com/matrix-org/dendrite/roomserver/api" "github.com/matrix-org/gomatrixserverlib" + + asAPI "github.com/matrix-org/dendrite/appservice/api" ) // RoomserverInternalAPIDatabase has the storage APIs needed to implement the alias API. @@ -90,17 +92,13 @@ func (r *RoomserverInternalAPI) GetRoomIDForAlias( return err } - /* - TODO: Why is this here? It creates an unnecessary dependency - from the roomserver to the appservice component, which should be - altogether optional. - + if r.asAPI != nil { // appservice component is wired in if roomID == "" { // No room found locally, try our application services by making a call to // the appservice component - aliasReq := appserviceAPI.RoomAliasExistsRequest{Alias: request.Alias} - var aliasResp appserviceAPI.RoomAliasExistsResponse - if err = r.AppserviceAPI.RoomAliasExists(ctx, &aliasReq, &aliasResp); err != nil { + aliasReq := asAPI.RoomAliasExistsRequest{Alias: request.Alias} + var aliasResp asAPI.RoomAliasExistsResponse + if err = r.asAPI.RoomAliasExists(ctx, &aliasReq, &aliasResp); err != nil { return err } @@ -111,7 +109,7 @@ func (r *RoomserverInternalAPI) GetRoomIDForAlias( } } } - */ + } response.RoomID = roomID return nil |