summaryrefslogtreecommitdiff
path: root/protocols/Discord/src/dispatch.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-01-09 01:03:17 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-01-09 01:03:17 +0300
commit4f8c1e527ab9b5421f3ebb1c61ffe9a859df82e4 (patch)
treeab5bf5bec8891993939b2d4c09ce3d1feba11b96 /protocols/Discord/src/dispatch.cpp
parent9ab52162d7d1e0bdbf47d412fcfe83d533f0708b (diff)
- misprint in a json field name;
- fix for parsing private channels; - fix for long gateway packets reading; - version bump
Diffstat (limited to 'protocols/Discord/src/dispatch.cpp')
-rw-r--r--protocols/Discord/src/dispatch.cpp20
1 files changed, 10 insertions, 10 deletions
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);
+ }
}
}