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
1 changed files with 12 additions and 0 deletions

View File

@ -4,6 +4,7 @@ use std::{
cmp,
collections::{BTreeMap, HashSet},
fmt::Write,
iter::once,
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
.stream()
.map(ToOwned::to_owned)
.chain(canonical_room_alias_server)
.chain(
self.services
.server