Rename avatarUrl -> avatar for API consistency

This commit is contained in:
Mason Sciotti 2017-10-16 10:41:35 -07:00 committed by Chris Marsh
parent b1d6a7c0fc
commit dafd85c39f
3 changed files with 7 additions and 7 deletions

View file

@ -83,7 +83,7 @@ static void handleDiscordJoinRequest(const DiscordJoinRequest* request)
char yn[4]; char yn[4];
printf("\nDiscord: join request from %s - %s - %s\n", printf("\nDiscord: join request from %s - %s - %s\n",
request->username, request->username,
request->avatarUrl, request->avatar,
request->userId); request->userId);
do { do {
printf("Accept? (y/n)"); printf("Accept? (y/n)");

View file

@ -44,7 +44,7 @@ typedef struct DiscordRichPresence {
typedef struct DiscordJoinRequest { typedef struct DiscordJoinRequest {
char userId[24]; char userId[24];
char username[48]; char username[48];
char avatarUrl[128]; char avatar[128];
} DiscordJoinRequest; } DiscordJoinRequest;
typedef struct DiscordEventHandlers { typedef struct DiscordEventHandlers {

View file

@ -2,9 +2,9 @@
#include "backoff.h" #include "backoff.h"
#include "discord_register.h" #include "discord_register.h"
#include "msg_queue.h"
#include "rpc_connection.h" #include "rpc_connection.h"
#include "serialization.h" #include "serialization.h"
#include "msg_queue.h"
#include <atomic> #include <atomic>
#include <chrono> #include <chrono>
@ -136,16 +136,16 @@ static void Discord_UpdateConnection(void)
auto user = GetObjMember(data, "user"); auto user = GetObjMember(data, "user");
auto userId = GetStrMember(user, "id"); auto userId = GetStrMember(user, "id");
auto username = GetStrMember(user, "username"); auto username = GetStrMember(user, "username");
auto avatarUrl = GetStrMember(user, "avatar"); auto avatar = GetStrMember(user, "avatar");
auto joinReq = JoinAskQueue.GetNextAddMessage(); auto joinReq = JoinAskQueue.GetNextAddMessage();
if (userId && username && joinReq) { if (userId && username && joinReq) {
StringCopy(joinReq->userId, userId); StringCopy(joinReq->userId, userId);
StringCopy(joinReq->username, username); StringCopy(joinReq->username, username);
if (avatarUrl) { if (avatar) {
StringCopy(joinReq->avatarUrl, avatarUrl); StringCopy(joinReq->avatar, avatar);
} }
else { else {
joinReq->avatarUrl[0] = 0; joinReq->avatar[0] = 0;
} }
JoinAskQueue.CommitAdd(); JoinAskQueue.CommitAdd();
} }