From 87fde7b2122fcc8cb763ec216e9ac3a07cf65bbc Mon Sep 17 00:00:00 2001 From: Aaron Weiss Date: Tue, 13 Jan 2015 03:57:56 -0500 Subject: [PATCH] list_users(...) now just returns None when nochanlists is enabled. --- src/client/server/mod.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/client/server/mod.rs b/src/client/server/mod.rs index 14ea5d0..704f54e 100644 --- a/src/client/server/mod.rs +++ b/src/client/server/mod.rs @@ -20,13 +20,14 @@ pub trait Server<'a, T, U> { fn config(&self) -> &Config; /// Sends a Command to this Server. #[stable] - fn send(&self, _: Command) -> IoResult<()>; + fn send(&self, command: Command) -> IoResult<()>; /// Gets an Iterator over Messages received by this Server. #[stable] fn iter(&'a self) -> ServerIterator<'a, T, U>; - /// Gets a list of Users in the specified channel. + /// Gets a list of Users in the specified channel. This will be none if the channel is not + /// being tracked, or if tracking is not supported altogether. #[stable] - fn list_users(&self, _: &str) -> Option>; + fn list_users(&self, channel: &str) -> Option>; } /// A thread-safe implementation of an IRC Server connection. @@ -94,9 +95,16 @@ impl<'a, T: IrcReader, U: IrcWriter> Server<'a, T, U> for IrcServer { ServerIterator::new(self) } + #[cfg(not(feature = "nochanlists"))] fn list_users(&self, chan: &str) -> Option> { self.chanlists.lock().unwrap().get(&chan.to_owned()).cloned() } + + + #[cfg(feature = "nochanlists")] + fn list_users(&self, chan: &str) -> Option> { + None + } } #[stable]