mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-12 01:13:10 -06:00
Apply requested changes
This commit is contained in:
parent
44ab32c298
commit
4731ae9c6d
|
|
@ -27,10 +27,6 @@ import (
|
||||||
"github.com/matrix-org/util"
|
"github.com/matrix-org/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
type roomID struct {
|
|
||||||
RoomID string `json:"room_id"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// DirectoryRoom looks up a room alias
|
// DirectoryRoom looks up a room alias
|
||||||
func DirectoryRoom(
|
func DirectoryRoom(
|
||||||
req *http.Request,
|
req *http.Request,
|
||||||
|
|
@ -118,7 +114,9 @@ func SetLocalAlias(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var r roomID
|
var r struct {
|
||||||
|
RoomID string `json:"room_id"`
|
||||||
|
}
|
||||||
if resErr := httputil.UnmarshalJSONRequest(req, &r); resErr != nil {
|
if resErr := httputil.UnmarshalJSONRequest(req, &r); resErr != nil {
|
||||||
return *resErr
|
return *resErr
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@ CREATE TABLE IF NOT EXISTS room_aliases (
|
||||||
-- Room ID the alias refers to
|
-- Room ID the alias refers to
|
||||||
room_id TEXT NOT NULL
|
room_id TEXT NOT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
CREATE UNIQUE INDEX IF NOT EXISTS room_id_idx ON room_aliases(room_id);
|
||||||
`
|
`
|
||||||
|
|
||||||
const insertRoomAliasSQL = "" +
|
const insertRoomAliasSQL = "" +
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue