summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2016-06-30 20:51:53 +0000
committerRobert Pösel <robyer@seznam.cz>2016-06-30 20:51:53 +0000
commitad5f64dcd8dc7944e85208d6ef32eb5adbb4ffe6 (patch)
treed84a78fbaf2721fe54144338760ba6797a724039 /protocols/FacebookRM/src
parent8463d02efba045a1fe0f48af3554e9ef1ae0ad58 (diff)
Facebook: Support receiving animated images (GIF) attachments
git-svn-id: http://svn.miranda-ng.org/main/trunk@17054 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src')
-rw-r--r--protocols/FacebookRM/src/json.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp
index e941383342..376e5da431 100644
--- a/protocols/FacebookRM/src/json.cpp
+++ b/protocols/FacebookRM/src/json.cpp
@@ -201,7 +201,7 @@ 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"];
- type = attach_["attach_type"].as_string(); // "sticker", "photo", "file", "share"
+ type = attach_["attach_type"].as_string(); // "sticker", "photo", "file", "share", "animated_image"
if (type == "photo") {
std::string filename = attach_["name"].as_string();
@@ -269,6 +269,13 @@ void parseAttachments(FacebookProto *proto, std::string *message_text, const JSO
}
}
}
+ else if (type == "animated_image") {
+ std::string link = attach_["hires_url"].as_string();
+
+ if (!link.empty()) {
+ attachments_text += "\n" + absolutizeUrl(link) + "\n";
+ }
+ }
else {
proto->debugLogA("json::parseAttachments (%s) - Unknown attachment type '%s'", legacy ? "legacy" : "not legacy", type.c_str());
}
@@ -288,6 +295,8 @@ void parseAttachments(FacebookProto *proto, std::string *message_text, const JSO
newText = (attachments_.size() > 1) ? TranslateT("files") : TranslateT("a file");
else if (type == "photo")
newText = (attachments_.size() > 1) ? TranslateT("photos") : TranslateT("a photo");
+ else if (type == "animated_image")
+ newText = TranslateT("a GIF");
else
newText = _A2T(type.c_str());