aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2017-07-25 21:04:36 -0700
committerZeyla Hellyer <[email protected]>2017-07-25 21:04:36 -0700
commit657258040376be45a8be0ef0e3bd762a23babb0a (patch)
treebbacba1a944a40f41f62e214c206af339aadc02e /src
parentActually, rename it to "is_own" instead (diff)
downloadserenity-657258040376be45a8be0ef0e3bd762a23babb0a.tar.xz
serenity-657258040376be45a8be0ef0e3bd762a23babb0a.zip
Fix is_own code
The current user ID is located on the `user` structfield in the cache, and is not directly on the cache.
Diffstat (limited to 'src')
-rw-r--r--src/model/channel/message.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/model/channel/message.rs b/src/model/channel/message.rs
index f0587a7..0305271 100644
--- a/src/model/channel/message.rs
+++ b/src/model/channel/message.rs
@@ -118,7 +118,7 @@ impl Message {
/// A util function for determining whether this message was sent by someone else, or the bot.
#[cfg(all(feature="cache", feature="utils"))]
pub fn is_own(&self) -> bool {
- self.author.id == CACHE.read().unwrap().id
+ self.author.id == CACHE.read().unwrap().user.id
}
/// Deletes the message.