diff --git a/mktestconfig.sh b/mktestconfig.sh index 62478bd..112af8e 100755 --- a/mktestconfig.sh +++ b/mktestconfig.sh @@ -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 diff --git a/src/client/data/config.rs b/src/client/data/config.rs index 8574b6e..c57ed3f 100644 --- a/src/client/data/config.rs +++ b/src/client/data/config.rs @@ -29,8 +29,6 @@ pub struct Config { /// The bot's real name. #[stable] pub realname: Option, - /// User modes to set on connect. Example: "+RB-x" - pub umodes: Option, /// The server to connect to. #[stable] pub server: Option, @@ -51,6 +49,9 @@ pub struct Config { /// A list of channels to join on connection. #[stable] pub channels: Option>, + /// User modes to set on connect. Example: "+RB-x" + #[unstable] + pub umodes: Option, /// The text that'll be sent in response to CTCP USERINFO requests. #[stable] pub user_info: Option, @@ -121,13 +122,6 @@ impl Config { 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. /// This panics when not specified. #[stable] @@ -174,6 +168,14 @@ impl Config { 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. /// This defaults to an empty string when not specified. #[unstable = "Feature is still relatively new."]