From 80d9ee519f9e432c750214ff1907e764b22ecc67 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 8 Jan 2017 14:26:39 +0300 Subject: idle status is not ID_STATUS_IDLE, but ID_STATUS_LONGAWAY --- protocols/Discord/src/server.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'protocols/Discord/src/server.cpp') diff --git a/protocols/Discord/src/server.cpp b/protocols/Discord/src/server.cpp index 39ad13bc50..c2c539f4d9 100644 --- a/protocols/Discord/src/server.cpp +++ b/protocols/Discord/src/server.cpp @@ -152,6 +152,17 @@ void CDiscordProto::SetServerStatus(int iStatus) if (iStatus == ID_STATUS_OFFLINE) Push(new AsyncHttpRequest(this, REQUEST_POST, "/auth/logout", NULL)); + else { + const char *pszStatus; + switch (iStatus) { + case ID_STATUS_NA: pszStatus = "idle"; break; + case ID_STATUS_DND: pszStatus = "dnd"; break; + case ID_STATUS_INVISIBLE: pszStatus = "invisible"; break; + default: pszStatus = "online"; break; + } + JSONNode root; root << CHAR_PARAM("status", pszStatus); + Push(new AsyncHttpRequest(this, REQUEST_PATCH, "/users/@me/settings", NULL, &root)); + } int iOldStatus = m_iStatus; m_iStatus = iStatus; ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)iOldStatus, m_iStatus); -- cgit v1.2.3