mirror of
https://github.com/yuzu-emu/discord-rpc.git
synced 2024-12-22 18:05:40 +00:00
Add discriminator to join request
This commit is contained in:
parent
c1a8899d02
commit
1a278528a2
|
@ -44,6 +44,7 @@ typedef struct DiscordRichPresence {
|
|||
typedef struct DiscordJoinRequest {
|
||||
const char* userId;
|
||||
const char* username;
|
||||
const char* discriminator;
|
||||
const char* avatar;
|
||||
} DiscordJoinRequest;
|
||||
|
||||
|
|
|
@ -193,6 +193,10 @@ static void Discord_UpdateConnection(void)
|
|||
if (userId && username && joinReq) {
|
||||
StringCopy(joinReq->userId, userId);
|
||||
StringCopy(joinReq->username, username);
|
||||
auto discriminator = GetStrMember(user, "discriminator");
|
||||
if (discriminator) {
|
||||
StringCopy(joinReq->discriminator, discriminator);
|
||||
}
|
||||
if (avatar) {
|
||||
StringCopy(joinReq->avatar, avatar);
|
||||
}
|
||||
|
@ -380,7 +384,7 @@ extern "C" DISCORD_EXPORT void Discord_RunCallbacks()
|
|||
while (JoinAskQueue.HavePendingSends()) {
|
||||
auto req = JoinAskQueue.GetNextSendMessage();
|
||||
if (Handlers.joinRequest) {
|
||||
DiscordJoinRequest djr{req->userId, req->username, req->avatar};
|
||||
DiscordJoinRequest djr{req->userId, req->username, req->discriminator, req->avatar};
|
||||
Handlers.joinRequest(&djr);
|
||||
}
|
||||
JoinAskQueue.CommitSend();
|
||||
|
|
Loading…
Reference in a new issue