Replace route calling routes with helpers

This fixes the panic from ruma "index out of bounds"
This commit is contained in:
Devin Ragotzy 2020-08-21 17:19:18 -04:00
parent 5ccdd3694b
commit fe795d38ea
3 changed files with 90 additions and 76 deletions

View file

@ -53,11 +53,11 @@ pub async fn get_alias_route(
db: State<'_, Database>,
body: Ruma<get_alias::IncomingRequest>,
) -> ConduitResult<get_alias::Response> {
get_alias_helper(db, &body.room_alias).await
get_alias_helper(&db, &body.room_alias).await
}
pub async fn get_alias_helper(
db: State<'_, Database>,
db: &Database,
room_alias: &RoomAliasId,
) -> ConduitResult<get_alias::Response> {
if room_alias.server_name() != db.globals.server_name() {