From fe69ef034c2d6561e05ff67f6a419b7b4a42c04e Mon Sep 17 00:00:00 2001 From: Zeyla Hellyer Date: Fri, 14 Sep 2018 21:45:04 -0700 Subject: Remove cache requirement on Message::is_private This can instead check the `guild_id` structfield, so the cache is no longer required. --- src/model/channel/message.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src') diff --git a/src/model/channel/message.rs b/src/model/channel/message.rs index b72849c..5589ad0 100644 --- a/src/model/channel/message.rs +++ b/src/model/channel/message.rs @@ -352,12 +352,8 @@ impl Message { } /// True if message was sent using direct messages. - #[cfg(feature = "cache")] pub fn is_private(&self) -> bool { - match CACHE.read().channel(self.channel_id) { - Some(Channel::Group(_)) | Some(Channel::Private(_)) => true, - _ => false, - } + self.guild_id.is_none() } /// Retrieves a clone of the author's Member instance, if this message was -- cgit v1.2.3