From dafd85c39ff55bb25906526b056ad42a679d8974 Mon Sep 17 00:00:00 2001 From: Mason Sciotti Date: Mon, 16 Oct 2017 10:41:35 -0700 Subject: [PATCH] Rename `avatarUrl` -> `avatar` for API consistency --- examples/send-presence/send-presence.c | 2 +- include/discord-rpc.h | 2 +- src/discord-rpc.cpp | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/send-presence/send-presence.c b/examples/send-presence/send-presence.c index 04e1425..332633c 100644 --- a/examples/send-presence/send-presence.c +++ b/examples/send-presence/send-presence.c @@ -83,7 +83,7 @@ static void handleDiscordJoinRequest(const DiscordJoinRequest* request) char yn[4]; printf("\nDiscord: join request from %s - %s - %s\n", request->username, - request->avatarUrl, + request->avatar, request->userId); do { printf("Accept? (y/n)"); diff --git a/include/discord-rpc.h b/include/discord-rpc.h index 3db5ad9..bff30f5 100644 --- a/include/discord-rpc.h +++ b/include/discord-rpc.h @@ -44,7 +44,7 @@ typedef struct DiscordRichPresence { typedef struct DiscordJoinRequest { char userId[24]; char username[48]; - char avatarUrl[128]; + char avatar[128]; } DiscordJoinRequest; typedef struct DiscordEventHandlers { diff --git a/src/discord-rpc.cpp b/src/discord-rpc.cpp index 9d7fa0a..1b846f0 100644 --- a/src/discord-rpc.cpp +++ b/src/discord-rpc.cpp @@ -2,9 +2,9 @@ #include "backoff.h" #include "discord_register.h" +#include "msg_queue.h" #include "rpc_connection.h" #include "serialization.h" -#include "msg_queue.h" #include #include @@ -136,16 +136,16 @@ static void Discord_UpdateConnection(void) auto user = GetObjMember(data, "user"); auto userId = GetStrMember(user, "id"); auto username = GetStrMember(user, "username"); - auto avatarUrl = GetStrMember(user, "avatar"); + auto avatar = GetStrMember(user, "avatar"); auto joinReq = JoinAskQueue.GetNextAddMessage(); if (userId && username && joinReq) { StringCopy(joinReq->userId, userId); StringCopy(joinReq->username, username); - if (avatarUrl) { - StringCopy(joinReq->avatarUrl, avatarUrl); + if (avatar) { + StringCopy(joinReq->avatar, avatar); } else { - joinReq->avatarUrl[0] = 0; + joinReq->avatar[0] = 0; } JoinAskQueue.CommitAdd(); }