fix getting canonical alias server for backfill

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-11-15 16:35:58 -05:00
parent 6b1b464abc
commit 9c95a74d56

View file

@ -4,6 +4,7 @@ use std::{
cmp, cmp,
collections::{BTreeMap, HashSet}, collections::{BTreeMap, HashSet},
fmt::Write, fmt::Write,
iter::once,
sync::Arc, sync::Arc,
}; };
@ -1076,9 +1077,20 @@ impl Service {
} }
}); });
let canonical_room_alias_server = once(
self.services
.state_accessor
.get_canonical_alias(room_id)
.await,
)
.filter_map(Result::ok)
.map(|alias| alias.server_name().to_owned())
.stream();
let mut servers = room_mods let mut servers = room_mods
.stream() .stream()
.map(ToOwned::to_owned) .map(ToOwned::to_owned)
.chain(canonical_room_alias_server)
.chain( .chain(
self.services self.services
.server .server