From 4b3ab972d3109f4014746fc8b1ea5b443697861c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 20 Jan 2017 23:19:29 +0300 Subject: - valid (but totally undocumented) way of reading guild users; - fix for decoding several replies from the single packet; --- protocols/Discord/src/utils.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'protocols/Discord/src/utils.cpp') 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 ¶m) -- cgit v1.2.3