aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2018-09-14 21:45:04 -0700
committerZeyla Hellyer <[email protected]>2018-09-14 21:45:47 -0700
commitfe69ef034c2d6561e05ff67f6a419b7b4a42c04e (patch)
tree24c38ae3781c8cb5bdc3dc4d186ab9f41004fb43 /src
parentMessage: avoid perm checks in non-guild channels (diff)
downloadserenity-fe69ef034c2d6561e05ff67f6a419b7b4a42c04e.tar.xz
serenity-fe69ef034c2d6561e05ff67f6a419b7b4a42c04e.zip
Remove cache requirement on Message::is_private
This can instead check the `guild_id` structfield, so the cache is no longer required.
Diffstat (limited to 'src')
-rw-r--r--src/model/channel/message.rs6
1 files changed, 1 insertions, 5 deletions
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