From 4f8c1e527ab9b5421f3ebb1c61ffe9a859df82e4 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 9 Jan 2017 01:03:17 +0300 Subject: - misprint in a json field name; - fix for parsing private channels; - fix for long gateway packets reading; - version bump --- protocols/Discord/src/dispatch.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'protocols/Discord/src/dispatch.cpp') diff --git a/protocols/Discord/src/dispatch.cpp b/protocols/Discord/src/dispatch.cpp index 0b7f96a33f..7f6365e085 100644 --- a/protocols/Discord/src/dispatch.cpp +++ b/protocols/Discord/src/dispatch.cpp @@ -148,16 +148,16 @@ void CDiscordProto::OnCommandReady(const JSONNode &pRoot) for (auto it = channels.begin(); it != channels.end(); ++it) { const JSONNode &p = *it; - const JSONNode &user = p["recipient"]; - if (!user) - continue; - - CDiscordUser *pUser = PrepareUser(user); - pUser->lastMessageId = _wtoi64(p["last_message_id"].as_mstring()); - pUser->channelId = _wtoi64(p["id"].as_mstring()); - pUser->bIsPrivate = true; - - setId(pUser->hContact, DB_KEY_CHANNELID, pUser->channelId); + const JSONNode &recipients = p["recipients"]; + for (auto it2 = recipients.begin(); it2 != recipients.end(); ++it2) { + const JSONNode &r = *it2; + CDiscordUser *pUser = PrepareUser(r); + pUser->lastMessageId = _wtoi64(r["last_message_id"].as_mstring()); + pUser->channelId = _wtoi64(p["id"].as_mstring()); + pUser->bIsPrivate = true; + + setId(pUser->hContact, DB_KEY_CHANNELID, pUser->channelId); + } } } -- cgit v1.2.3