Skip to content

Commit

Permalink
Merge pull request #295 from andymandias/fix/znc-client-identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
casperstorm committed Mar 24, 2024
2 parents 40b9a8c + d9168a0 commit cefbe00
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Unreleased

Fixed:

- Accept '@' in usernames to support bouncers that use the user@identifier/network convention

# 2024.5 (2024-03-21)

**BREAKING** Configuration file format has switched from `YAML` to `TOML`. Please vist the migration guide here: [halloy.squidowl.org/guides/migrating-from-yaml](https://halloy.squidowl.org/guides/migrating-from-yaml.html).
Expand Down
13 changes: 11 additions & 2 deletions irc/proto/src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ fn space(input: &str) -> IResult<&str, ()> {
fn user(input: &str) -> IResult<&str, User> {
// <sequence of any characters except NUL, CR, LF, and SPACE> and @
let username = recognize(many1_count(none_of("\0\r\n @")));
// "-", "[", "]", "\", "`", "_", "^", "{", "|", "}", "*", "/"
let special = one_of("-[]\\`_^{|}*/");
// "-", "[", "]", "\", "`", "_", "^", "{", "|", "}", "*", "/", "@"
let special = one_of("-[]\\`_^{|}*/@");
// *( <letter> | <number> | <special> )
let nickname = recognize(many1_count(alt((
satisfy(|c| c.is_ascii_alphanumeric()),
Expand Down Expand Up @@ -168,6 +168,7 @@ mod test {
fn user() {
let tests = [
"dan!d@localhost",
"dan@id/network!d@remote.host",
"test!test@5555:5555:0:55:5555:5555:5555:5555",
"[asdf]!~asdf@user/asdf/x-5555555",
];
Expand All @@ -192,6 +193,14 @@ mod test {
hostname: Some("localhost".into()),
}),
),
(
":dan@id/network!d@remote.host ",
Source::User(User {
nickname: "dan@id/network".into(),
username: Some("d".into()),
hostname: Some("remote.host".into()),
}),
),
(
":atw.hu.quakenet.org ",
Source::Server("atw.hu.quakenet.org".into()),
Expand Down

0 comments on commit cefbe00

Please sign in to comment.