diff options
Diffstat (limited to 'src/api/client_server/alias.rs')
-rw-r--r-- | src/api/client_server/alias.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/api/client_server/alias.rs b/src/api/client_server/alias.rs index ab51b50..7660ca2 100644 --- a/src/api/client_server/alias.rs +++ b/src/api/client_server/alias.rs @@ -1,4 +1,5 @@ use crate::{services, Error, Result, Ruma}; +use rand::seq::SliceRandom; use regex::Regex; use ruma::{ api::{ @@ -90,10 +91,10 @@ pub(crate) async fn get_alias_helper( ) .await?; - return Ok(get_alias::v3::Response::new( - response.room_id, - response.servers, - )); + let mut servers = response.servers; + servers.shuffle(&mut rand::thread_rng()); + + return Ok(get_alias::v3::Response::new(response.room_id, servers)); } let mut room_id = None; |