aboutsummaryrefslogtreecommitdiff
path: root/src/ext/cache
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2017-03-20 22:05:12 -0700
committerZeyla Hellyer <[email protected]>2017-03-20 22:10:15 -0700
commitcd914f503c8f0ada7473b5b56e4ad7830370ea45 (patch)
tree3f72ca3f878efe2d96a1e64479e6e23dc7c95113 /src/ext/cache
parentFix deadlock/panic on channel create event for private messages (diff)
downloadserenity-cd914f503c8f0ada7473b5b56e4ad7830370ea45.tar.xz
serenity-cd914f503c8f0ada7473b5b56e4ad7830370ea45.zip
Fix Member methods due to variant joined_at values
Fix an issue where the library would check the Id of the guild that a member is in by checking the Member's ID and joined_at value with those of the members of guilds present in the cache. Performing this check would have the issue of where a joined_at for a member received over websocket would potentially have a varying value than that of the same member retrieved over REST. To fix this, attach the relevant guild's Id to the member on creation, where the Id is available. Fixes #68.
Diffstat (limited to 'src/ext/cache')
-rw-r--r--src/ext/cache/mod.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ext/cache/mod.rs b/src/ext/cache/mod.rs
index 7d00b2a..ad0ef31 100644
--- a/src/ext/cache/mod.rs
+++ b/src/ext/cache/mod.rs
@@ -804,6 +804,7 @@ impl Cache {
if !found {
guild.members.insert(event.user.id, Member {
deaf: false,
+ guild_id: Some(event.guild_id),
joined_at: String::default(),
mute: false,
nick: event.nick.clone(),