Skip to content
Extraits de code Groupes Projets
Vérifiée Valider dbd30e7d rédigé par Kubat's avatar Kubat
Parcourir les fichiers

Fix ACL construction => room id is case sensitive

parent b2efbd8a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -121,10 +121,10 @@ impl CmdAcl {
}
fn from_string_item(string: &str) -> CmdAcl {
if string == "ADMINONLY" {
if string.to_uppercase() == "ADMINONLY" {
CmdAcl::AdminOnly
} else if string.starts_with("ROOM!") {
let room = string.strip_prefix("ROOM").unwrap().to_string();
} else if string.to_uppercase().starts_with("ROOM!") {
let room = (&string[4..]).to_string();
CmdAcl::RoomOnly(room)
} else {
error!("Unknown ACL: {}", string);
......@@ -135,7 +135,6 @@ impl CmdAcl {
#[allow(dead_code)]
pub fn from_string(string: String) -> CmdAcl {
let acl_list = string
.to_uppercase()
.split(",")
.map(|x| CmdAcl::from_string_item(x.trim()))
.collect::<Vec<CmdAcl>>();
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter