summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-02-04 18:46:08 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-02-04 18:46:08 +0300
commit331ba950bb27975c26ec1b54a9f47689aee0003b (patch)
tree058ea3bcfdb5f45ea1ec90eee4dda3b40a8d4f93
parentbe4211fd9b777a113f8dea0701bdecd29f41fa9d (diff)
Discord: correct status mapping for ID_STATUS_AWAY
-rw-r--r--protocols/Discord/src/proto.cpp1
-rw-r--r--protocols/Discord/src/server.cpp13
2 files changed, 10 insertions, 4 deletions
diff --git a/protocols/Discord/src/proto.cpp b/protocols/Discord/src/proto.cpp
index 4e00497dca..b7ca36a546 100644
--- a/protocols/Discord/src/proto.cpp
+++ b/protocols/Discord/src/proto.cpp
@@ -106,6 +106,7 @@ DWORD_PTR CDiscordProto::GetCaps(int type, MCONTACT)
case PFLAGNUM_1:
return PF1_IM | PF1_MODEMSGRECV | PF1_SERVERCLIST | PF1_BASICSEARCH | PF1_EXTSEARCH | PF1_ADDSEARCHRES | PF1_FILESEND;
case PFLAGNUM_2:
+ return PF2_ONLINE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_HEAVYDND | PF2_INVISIBLE;
case PFLAGNUM_3:
return PF2_ONLINE | PF2_LONGAWAY | PF2_HEAVYDND | PF2_INVISIBLE;
case PFLAGNUM_4:
diff --git a/protocols/Discord/src/server.cpp b/protocols/Discord/src/server.cpp
index 0a55c78de0..5033e5aefd 100644
--- a/protocols/Discord/src/server.cpp
+++ b/protocols/Discord/src/server.cpp
@@ -199,10 +199,15 @@ void CDiscordProto::SetServerStatus(int iStatus)
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;
+ case ID_STATUS_AWAY:
+ 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));