diff --git a/README.md b/README.md index 088dde5..33ccec5 100644 --- a/README.md +++ b/README.md @@ -45,8 +45,8 @@ people joining in with the respective privileges. Further, `bob@work` can join o `h@cafe`, whose comment is tagged as `:admin` will be able to join the chat with admin privileges. > [!NOTE] -Usernames may only contain ASCII alphanumeric characters and the `@` -symbol. All other characters will be stripped. +Usernames may only contain ASCII alphanumeric characters and the symbols `@-_.`. +All other characters will be stripped. ### Getting started diff --git a/src/authfile.rs b/src/authfile.rs index f733fc6..d803ad0 100644 --- a/src/authfile.rs +++ b/src/authfile.rs @@ -10,7 +10,7 @@ use russh::keys::ssh_key::public::KeyData; pub fn sanitize_name(s: &str) -> String { let mut sanitized = String::with_capacity(s.len()); for c in s.chars() { - let ok = c.is_ascii_alphanumeric() || c == '@'; + let ok = c.is_ascii_alphanumeric() || "@_-.".contains(c); if !ok { continue; }