diff options
author | George Hazan <ghazan@miranda.im> | 2017-02-01 15:35:35 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-02-01 15:35:35 +0300 |
commit | a394c200ee2664b177d376259ab26b78bb854c19 (patch) | |
tree | 4d242c59abf14e7ae7270d4c6e88bce753bd984b /protocols/Discord/src/dispatch.cpp | |
parent | 1c2dead34ab9c54829cb0f27a7bfe0e917474ec0 (diff) |
added handler for a USER_SETTINGS_UPDATE command
Diffstat (limited to 'protocols/Discord/src/dispatch.cpp')
-rw-r--r-- | protocols/Discord/src/dispatch.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/protocols/Discord/src/dispatch.cpp b/protocols/Discord/src/dispatch.cpp index 0dc544eab1..becbab63f9 100644 --- a/protocols/Discord/src/dispatch.cpp +++ b/protocols/Discord/src/dispatch.cpp @@ -44,6 +44,7 @@ static handlers[] = // these structures must me sorted alphabetically { L"TYPING_START", &CDiscordProto::OnCommandTyping }, + { L"USER_SETTINGS_UPDATE", &CDiscordProto::OnCommandUserSettingsUpdate }, { L"USER_UPDATE", &CDiscordProto::OnCommandUserUpdate }, }; @@ -425,3 +426,12 @@ void CDiscordProto::OnCommandUserUpdate(const JSONNode &pRoot) RetrieveAvatar(hContact); } } + +void CDiscordProto::OnCommandUserSettingsUpdate(const JSONNode &pRoot) +{ + int iStatus = StrToStatus(pRoot["status"].as_mstring()); + if (iStatus != 0) { + int iOldStatus = m_iStatus; m_iStatus = iStatus; + ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)iOldStatus, m_iStatus); + } +} |