[ifcbrk] feature: Implement Client Status Support (#1247)

* Implement Client Status Support

Adds support for using the client_status as sent as part of the Presence model. This value can be used to determine if a user is active on the native desktop app, the mobile app, or the website.

* lint: whitespace in IPresence

* Remove breaking change to IPresence interface with a note for 2.1

* update comment to not reference 2.1

* re-add interface break to IPresence

* add example payload for client_status

* use inline declaration for Enum.TryParse
This commit is contained in:
Chris Johnston
2019-06-22 20:46:20 -07:00
committed by Christopher F
parent c870e672a2
commit 9da11b4184
9 changed files with 80 additions and 10 deletions

View File

@@ -325,7 +325,7 @@ namespace Discord.WebSocket
{
var user = SocketGlobalUser.Create(this, state, model);
user.GlobalUser.AddRef();
user.Presence = new SocketPresence(UserStatus.Online, null);
user.Presence = new SocketPresence(UserStatus.Online, null, null);
return user;
});
}
@@ -433,7 +433,7 @@ namespace Discord.WebSocket
return;
var status = Status;
var statusSince = _statusSince;
CurrentUser.Presence = new SocketPresence(status, Activity);
CurrentUser.Presence = new SocketPresence(status, Activity, null);
var gameModel = new GameModel();
// Discord only accepts rich presence over RPC, don't even bother building a payload