mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-18 12:23:09 -06:00
Register Canonical Alias API with roomserver.go
This commit is contained in:
parent
365ce809f6
commit
7cafbd3786
|
|
@ -34,7 +34,7 @@ import (
|
||||||
// APIs directly instead of having to use HTTP.
|
// APIs directly instead of having to use HTTP.
|
||||||
func SetupRoomServerComponent(
|
func SetupRoomServerComponent(
|
||||||
base *basecomponent.BaseDendrite,
|
base *basecomponent.BaseDendrite,
|
||||||
) (api.RoomserverAliasAPI, api.RoomserverInputAPI, api.RoomserverQueryAPI) {
|
) (api.RoomserverAliasAPI, api.RoomserverCanonicalAliasAPI, api.RoomserverInputAPI, api.RoomserverQueryAPI) {
|
||||||
roomserverDB, err := storage.Open(string(base.Cfg.Database.RoomServer))
|
roomserverDB, err := storage.Open(string(base.Cfg.Database.RoomServer))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.WithError(err).Panicf("failed to connect to room server db")
|
logrus.WithError(err).Panicf("failed to connect to room server db")
|
||||||
|
|
@ -64,5 +64,14 @@ func SetupRoomServerComponent(
|
||||||
|
|
||||||
aliasAPI.SetupHTTP(http.DefaultServeMux)
|
aliasAPI.SetupHTTP(http.DefaultServeMux)
|
||||||
|
|
||||||
return &aliasAPI, &inputAPI, &queryAPI
|
canonicalAliasAPI := canonicalAlias.RoomserverCanonicalAliasAPI{
|
||||||
|
DB: roomserverDB,
|
||||||
|
Cfg: base.Cfg,
|
||||||
|
InputAPI: &inputAPI,
|
||||||
|
QueryAPI: &queryAPI,
|
||||||
|
AppserviceAPI: &asAPI,
|
||||||
|
}
|
||||||
|
canonicalAliasAPI.SetupHTTP(http.DefaultServeMux)
|
||||||
|
|
||||||
|
return &aliasAPI, &canonicalAliasAPI, &inputAPI, &queryAPI
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue