mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 11:33:30 +01:00
Added user presence tracking changes
User status in cache is now updated as well as firing the event
This commit is contained in:
@@ -1087,6 +1087,7 @@ var Client = (function () {
|
|||||||
var presenceUser = new User(data.user);
|
var presenceUser = new User(data.user);
|
||||||
if (presenceUser.equalsStrict(userInCache)) {
|
if (presenceUser.equalsStrict(userInCache)) {
|
||||||
//they're exactly the same, an actual presence update
|
//they're exactly the same, an actual presence update
|
||||||
|
userInCache.status = data.status;
|
||||||
self.trigger("presence", {
|
self.trigger("presence", {
|
||||||
user: userInCache,
|
user: userInCache,
|
||||||
status: data.status,
|
status: data.status,
|
||||||
|
|||||||
@@ -992,6 +992,7 @@ class Client {
|
|||||||
var presenceUser = new User(data.user);
|
var presenceUser = new User(data.user);
|
||||||
if (presenceUser.equalsStrict(userInCache)) {
|
if (presenceUser.equalsStrict(userInCache)) {
|
||||||
//they're exactly the same, an actual presence update
|
//they're exactly the same, an actual presence update
|
||||||
|
userInCache.status = data.status;
|
||||||
self.trigger("presence", {
|
self.trigger("presence", {
|
||||||
user: userInCache,
|
user: userInCache,
|
||||||
status: data.status,
|
status: data.status,
|
||||||
|
|||||||
Reference in New Issue
Block a user