Readded current_nickname to IrcServer interface (fixes #91).

This commit is contained in:
Aaron Weiss 2017-06-25 19:36:38 -07:00
parent c841e2cca9
commit 7712a5536b
No known key found for this signature in database
GPG key ID: 0237035D9BF03AE2

View file

@ -195,7 +195,7 @@ impl ServerState {
}
/// Gets the current nickname in use.
pub fn current_nickname(&self) -> &str {
fn current_nickname(&self) -> &str {
let alt_nicks = self.config().alternate_nicknames();
let index = self.alt_nick_index.read().unwrap();
match *index {
@ -566,6 +566,11 @@ impl IrcServer {
})
}
/// Gets the current nickname in use.
pub fn current_nickname(&self) -> &str {
self.state.current_nickname()
}
/// Gets the log view from the internal transport. Only used for unit testing.
#[cfg(test)]
fn log_view(&self) -> &LogView {