aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/tell/mod.rs23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/plugins/tell/mod.rs b/src/plugins/tell/mod.rs
index f3ca90c..e8a2bb6 100644
--- a/src/plugins/tell/mod.rs
+++ b/src/plugins/tell/mod.rs
@@ -65,16 +65,19 @@ impl<T: Database> Tell<T> {
.list_channels()
.expect("The irc crate should not be compiled with the \"nochanlists\" feature");
- for channel in channels {
- if let Some(users) = client.list_users(&channel) {
- if users
- .iter()
- .any(|u| u.get_nickname().eq_ignore_ascii_case(&receiver))
- {
- online.push(receiver);
- continue;
- }
- }
+ if let Some(_) = channels
+ .iter()
+ .map(|c| client.list_users(&c))
+ .map(|opt| {
+ opt.and_then(|us| {
+ us.into_iter()
+ .find(|u| u.get_nickname().eq_ignore_ascii_case(&receiver))
+ })
+ })
+ .find(|opt| opt.is_some())
+ {
+ online.push(receiver);
+ continue;
}
let tm = time::now().to_timespec();