diff options
author | George Hazan <ghazan@miranda.im> | 2017-01-08 14:26:39 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-01-08 14:26:39 +0300 |
commit | 80d9ee519f9e432c750214ff1907e764b22ecc67 (patch) | |
tree | 0f707c7ecc2cb57c72d8766e5fec840cf8988d71 /protocols/Discord/src/server.cpp | |
parent | e174bd86d17870fdbaa77a1b43575c584a1b33f5 (diff) |
idle status is not ID_STATUS_IDLE, but ID_STATUS_LONGAWAY
Diffstat (limited to 'protocols/Discord/src/server.cpp')
-rw-r--r-- | protocols/Discord/src/server.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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); |