Fixed bug in nochanlists from handle_message rewrite.

This commit is contained in:
Aaron Weiss 2016-01-19 15:23:09 -05:00
parent 5df4d26c07
commit bf9bd3ecb8

View file

@ -339,14 +339,14 @@ impl<T: IrcRead, U: IrcWrite> IrcServer<T, U> where Connection<T, U>: Reconnect
} else if let Ok(cmd) = msg.into() {
match cmd {
PING(data, _) => try!(self.send_pong(&data)),
JOIN(chan, _, _) => {
JOIN(chan, _, _) => if cfg!(not(feature = "nochanlists")) {
if let Some(vec) = self.chanlists().lock().unwrap().get_mut(&chan.to_owned()) {
if let Some(src) = msg.get_source_nickname() {
vec.push(User::new(src))
}
}
},
PART(chan, _) => {
PART(chan, _) => if cfg!(not(feature = "nochanlists")) {
if let Some(vec) = self.chanlists().lock().unwrap().get_mut(&chan.to_owned()) {
if let Some(src) = msg.get_source_nickname() {
if let Some(n) = vec.iter().position(|x| x.get_nickname() == src) {