Apply requested changes

This commit is contained in:
Brendan Abolivier 2017-07-28 11:22:38 +01:00
parent 44ab32c298
commit 4731ae9c6d
No known key found for this signature in database
GPG key ID: 8EF1500759F70623
2 changed files with 5 additions and 5 deletions

View file

@ -27,10 +27,6 @@ import (
"github.com/matrix-org/util"
)
type roomID struct {
RoomID string `json:"room_id"`
}
// DirectoryRoom looks up a room alias
func DirectoryRoom(
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 {
return *resErr
}

View file

@ -26,6 +26,8 @@ CREATE TABLE IF NOT EXISTS room_aliases (
-- Room ID the alias refers to
room_id TEXT NOT NULL
);
CREATE UNIQUE INDEX IF NOT EXISTS room_id_idx ON room_aliases(room_id);
`
const insertRoomAliasSQL = "" +