Merge pull request #178 from jesopo/develop

Don't send an empty CTCP SOURCE response
This commit is contained in:
Aaron Weiss 2019-06-03 14:07:31 -04:00 committed by GitHub
commit 4edb99f000
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -550,8 +550,7 @@ impl ClientState {
self.send_ctcp_internal(
resp,
&format!("SOURCE {}", self.config().source()),
)?;
self.send_ctcp_internal(resp, "SOURCE")
)
} else if tokens[0].eq_ignore_ascii_case("PING") && tokens.len() > 1 {
self.send_ctcp_internal(resp, &format!("PING {}", tokens[1]))
} else if tokens[0].eq_ignore_ascii_case("TIME") {
@ -1299,8 +1298,7 @@ mod test {
}).unwrap();
assert_eq!(
&get_client_value(client)[..],
"NOTICE test :\u{001}SOURCE https://github.com/aatxe/irc\u{001}\r\n\
NOTICE test :\u{001}SOURCE\u{001}\r\n"
"NOTICE test :\u{001}SOURCE https://github.com/aatxe/irc\u{001}\r\n"
);
}