Clean up after #14. Updated test config script.
This commit is contained in:
parent
ced1b7fa9a
commit
a820310b9c
2 changed files with 12 additions and 10 deletions
|
@ -1 +1 @@
|
||||||
echo "{\"owners\": [\"test\"],\"nickname\": \"test\",\"username\": \"test\",\"realname\": \"test\",\"password\": \"\",\"server\": \"irc.test.net\",\"port\": 6667,\"use_ssl\": false,\"encoding\": \"UTF-8\",\"channels\": [\"#test\", \"#test2\"],\"options\": {}}" > client_config.json
|
echo "{\"owners\": [\"test\"],\"nickname\": \"test\",\"username\": \"test\",\"realname\": \"test\",\"password\": \"\",\"server\": \"irc.test.net\",\"port\": 6667,\"use_ssl\": false,\"encoding\": \"UTF-8\",\"channels\": [\"#test\", \"#test2\"],\"umodes\": \"+BR\",\"options\": {}}" > client_config.json
|
||||||
|
|
|
@ -29,8 +29,6 @@ pub struct Config {
|
||||||
/// The bot's real name.
|
/// The bot's real name.
|
||||||
#[stable]
|
#[stable]
|
||||||
pub realname: Option<String>,
|
pub realname: Option<String>,
|
||||||
/// User modes to set on connect. Example: "+RB-x"
|
|
||||||
pub umodes: Option<String>,
|
|
||||||
/// The server to connect to.
|
/// The server to connect to.
|
||||||
#[stable]
|
#[stable]
|
||||||
pub server: Option<String>,
|
pub server: Option<String>,
|
||||||
|
@ -51,6 +49,9 @@ pub struct Config {
|
||||||
/// A list of channels to join on connection.
|
/// A list of channels to join on connection.
|
||||||
#[stable]
|
#[stable]
|
||||||
pub channels: Option<Vec<String>>,
|
pub channels: Option<Vec<String>>,
|
||||||
|
/// User modes to set on connect. Example: "+RB-x"
|
||||||
|
#[unstable]
|
||||||
|
pub umodes: Option<String>,
|
||||||
/// The text that'll be sent in response to CTCP USERINFO requests.
|
/// The text that'll be sent in response to CTCP USERINFO requests.
|
||||||
#[stable]
|
#[stable]
|
||||||
pub user_info: Option<String>,
|
pub user_info: Option<String>,
|
||||||
|
@ -121,13 +122,6 @@ impl Config {
|
||||||
self.realname.as_ref().map(|s| &s[]).unwrap_or(self.nickname())
|
self.realname.as_ref().map(|s| &s[]).unwrap_or(self.nickname())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Gets the user modes set on connect specified in the configuration.
|
|
||||||
/// This defaults to an empty string when not specified.
|
|
||||||
#[stable]
|
|
||||||
pub fn umodes(&self) -> &str {
|
|
||||||
self.umodes.as_ref().map(|s| &s[]).unwrap_or("")
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Gets the address of the server specified in the configuration.
|
/// Gets the address of the server specified in the configuration.
|
||||||
/// This panics when not specified.
|
/// This panics when not specified.
|
||||||
#[stable]
|
#[stable]
|
||||||
|
@ -174,6 +168,14 @@ impl Config {
|
||||||
self.channels.as_ref().map(|v| v.iter().map(|s| &s[]).collect()).unwrap_or(vec![])
|
self.channels.as_ref().map(|v| v.iter().map(|s| &s[]).collect()).unwrap_or(vec![])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Gets the user modes to set on connect specified in the configuration.
|
||||||
|
/// This defaults to an empty string when not specified.
|
||||||
|
#[unstable = "Feature is still relatively new."]
|
||||||
|
pub fn umodes(&self) -> &str {
|
||||||
|
self.umodes.as_ref().map(|s| &s[]).unwrap_or("")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Gets the string to be sent in response to CTCP USERINFO requests.
|
/// Gets the string to be sent in response to CTCP USERINFO requests.
|
||||||
/// This defaults to an empty string when not specified.
|
/// This defaults to an empty string when not specified.
|
||||||
#[unstable = "Feature is still relatively new."]
|
#[unstable = "Feature is still relatively new."]
|
||||||
|
|
Loading…
Add table
Reference in a new issue