summaryrefslogtreecommitdiff
path: root/protocols/Discord/src/utils.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-01-20 23:19:29 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-01-20 23:19:29 +0300
commit4b3ab972d3109f4014746fc8b1ea5b443697861c (patch)
tree7b5eb03f1b7c3a66fce857ffd30b5774e2cd268e /protocols/Discord/src/utils.cpp
parentbe6e15b71fcf555aad8bfd9054ca66ec71b91408 (diff)
- valid (but totally undocumented) way of reading guild users;
- fix for decoding several replies from the single packet;
Diffstat (limited to 'protocols/Discord/src/utils.cpp')
-rw-r--r--protocols/Discord/src/utils.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/protocols/Discord/src/utils.cpp b/protocols/Discord/src/utils.cpp
index e63df2f826..38b4af4bdd 100644
--- a/protocols/Discord/src/utils.cpp
+++ b/protocols/Discord/src/utils.cpp
@@ -24,6 +24,17 @@ void CDiscordProto::SetAllContactStatuses(int status)
setWord(hContact, "Status", (WORD)status);
}
+int StrToStatus(const CMStringW &str)
+{
+ if (str == L"idle")
+ return ID_STATUS_IDLE;
+ if (str == L"online")
+ return ID_STATUS_ONLINE;
+ if (str == L"offline")
+ return ID_STATUS_OFFLINE;
+ return 0;
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
JSONNode& operator<<(JSONNode &json, const INT_PARAM &param)