Changed CTCP VERSION to include the real version number by default.
This commit is contained in:
parent
ec8fdeb2e9
commit
2055603a5d
2 changed files with 10 additions and 2 deletions
|
@ -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.
|
||||
|
|
|
@ -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",
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue