added .oldStatus to presence update

This commit is contained in:
hydrabolt
2015-10-09 18:02:45 +01:00
parent 083ed54274
commit eb539015ca
2 changed files with 4 additions and 2 deletions

View File

@@ -1083,13 +1083,14 @@ var Client = (function () {
var presenceUser = new User(data.user);
if (presenceUser.equalsStrict(userInCache)) {
//they're exactly the same, an actual presence update
userInCache.status = data.status;
self.trigger("presence", {
user: userInCache,
oldStatus: userInCache.status,
status: data.status,
server: self.getServer("id", data.guild_id),
gameId: data.game_id
});
userInCache.status = data.status;
} else {
//one of their details changed.
self.userCache[self.userCache.indexOf(userInCache)] = presenceUser;

View File

@@ -992,13 +992,14 @@ class Client {
var presenceUser = new User(data.user);
if (presenceUser.equalsStrict(userInCache)) {
//they're exactly the same, an actual presence update
userInCache.status = data.status;
self.trigger("presence", {
user: userInCache,
oldStatus : userInCache.status,
status: data.status,
server: self.getServer("id", data.guild_id),
gameId: data.game_id
});
userInCache.status = data.status;
} else {
//one of their details changed.
self.userCache[self.userCache.indexOf(userInCache)] = presenceUser;