From 42f6d47af11bb7af26cbd9a45b1d2d293f9fae4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Sun, 10 Dec 2017 11:38:21 +0100 Subject: Wip - Fix receiving messages attachments --- protocols/FacebookRM/src/json.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'protocols/FacebookRM/src/json.cpp') 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") { -- cgit v1.2.3