Skip to content

Commit

Permalink
Don't do any other fuzz about private channels if they're already in …
Browse files Browse the repository at this point in the history
…the cache
  • Loading branch information
arqunis committed Aug 11, 2017
1 parent 32de2cb commit 7e8da0c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cache/cache_events_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ impl CacheEventsImpl for super::Cache {
.map(Channel::Guild)
},
Channel::Private(ref channel) => {
if let Some(ref channel) = self.private_channels.get(&channel.read().unwrap().id) {
return Some(Channel::Private((*channel).clone()));
}

let channel = channel.clone();

let mut channel_writer = channel.write().unwrap();
Expand Down

0 comments on commit 7e8da0c

Please sign in to comment.