summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2017-12-10 11:38:21 +0100
committerRobert Pösel <robyer@seznam.cz>2017-12-10 11:38:21 +0100
commit42f6d47af11bb7af26cbd9a45b1d2d293f9fae4f (patch)
treea825d400b0543342272f1db02b5fbdd8280a25d2 /protocols
parent177c0b2f3410f7cf14b52ff33e00ff26bcbd37d8 (diff)
Wip - Fix receiving messages attachments
Diffstat (limited to 'protocols')
-rw-r--r--protocols/FacebookRM/src/json.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp
index 2deb45172f..0495cdaaeb 100644
--- a/protocols/FacebookRM/src/json.cpp
+++ b/protocols/FacebookRM/src/json.cpp
@@ -282,6 +282,11 @@ void parseAttachments(FacebookProto *proto, std::string *message_text, const JSO
for (auto itAttachment = attachments_.begin(); itAttachment != attachments_.end(); ++itAttachment) {
const JSONNode &attach_ = legacy ? (*itAttachment) : (*itAttachment)["mercury"];
+ // FIXME: FB now doesn't have single "attach_type" node that we can check, but it's separated in different nodes. So we must check existence of different nodes for different types of attachments (or iterate over all existing nodes and check if some attachment node exists)
+ const JSONNode sticker_ = attach_["sticker_attachment"];
+ const JSONNode blob_ = attach_["blob_attachment"];
+ const JSONNode todo_ = attach_["todo"];
+
type = attach_["attach_type"].as_string(); // "sticker", "photo", "file", "share", "animated_image", "video"
if (type == "photo") {