From dbd30e7dfb74573b3959331faa6e1d894e660773 Mon Sep 17 00:00:00 2001 From: Kubat <mael.martin31@gmail.com> Date: Tue, 14 Dec 2021 23:19:35 +0100 Subject: [PATCH] Fix ACL construction => room id is case sensitive --- src/cmd/acl.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cmd/acl.rs b/src/cmd/acl.rs index 6963230..527cd4a 100644 --- a/src/cmd/acl.rs +++ b/src/cmd/acl.rs @@ -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>>(); -- GitLab