Changed CTCP VERSION to include the real version number by default.

This commit is contained in:
Aaron Weiss 2017-06-22 15:04:27 -04:00
parent ec8fdeb2e9
commit 2055603a5d
No known key found for this signature in database
GPG key ID: 0237035D9BF03AE2
2 changed files with 10 additions and 2 deletions

View file

@ -220,9 +220,10 @@ impl Config {
}
/// Gets the string to be sent in response to CTCP VERSION requests.
/// This defaults to `irc:git:Rust` when not specified.
/// This defaults to `irc:version:env` when not specified.
/// For example, `irc:0.12.0:Compiled with rustc`
pub fn version(&self) -> &str {
self.version.as_ref().map_or("irc:git:Rust", |s| &s)
self.version.as_ref().map_or(::VERSION_STR, |s| &s)
}
/// Gets the string to be sent in response to CTCP SOURCE requests.

View file

@ -24,3 +24,10 @@ pub mod client;
pub mod error;
pub mod proto;
pub mod server;
const VERSION_STR: &'static str = concat!(
env!("CARGO_PKG_NAME"),
":",
env!("CARGO_PKG_VERSION"),
":Compiled with rustc",
);