Simplify feature condition.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -125,27 +125,17 @@ pub async fn try_auth(
|
||||
|
||||
match auth {
|
||||
// Find out what the user completed
|
||||
| AuthData::Password(Password {
|
||||
identifier,
|
||||
password,
|
||||
#[cfg(feature = "element_hacks")]
|
||||
user,
|
||||
..
|
||||
}) => {
|
||||
#[cfg(feature = "element_hacks")]
|
||||
| AuthData::Password(Password { identifier, password, user, .. }) => {
|
||||
let username = if let Some(UserIdentifier::UserIdOrLocalpart(username)) = identifier {
|
||||
username
|
||||
} else if let Some(username) = user {
|
||||
} else if cfg!(feature = "element_hacks")
|
||||
&& let Some(username) = user
|
||||
{
|
||||
username
|
||||
} else {
|
||||
return Err!(Request(Unrecognized("Identifier type not recognized.")));
|
||||
};
|
||||
|
||||
#[cfg(not(feature = "element_hacks"))]
|
||||
let Some(UserIdentifier::UserIdOrLocalpart(username)) = identifier else {
|
||||
return Err!(Request(Unrecognized("Identifier type not recognized.")));
|
||||
};
|
||||
|
||||
let user_id_from_username = UserId::parse_with_server_name(
|
||||
username.clone(),
|
||||
self.services.globals.server_name(),
|
||||
|
||||
Reference in New Issue
Block a user