From b8b41d0805ea46e47f4b5c94ad25581a467b5111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Fri, 21 Feb 2014 19:58:17 +0000 Subject: Facebook: temporary workaround to "receive" unsupported attachments in messages git-svn-id: http://svn.miranda-ng.org/main/trunk@8206 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/json.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'protocols') diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp index ebb3864744..75eb094e6b 100644 --- a/protocols/FacebookRM/src/json.cpp +++ b/protocols/FacebookRM/src/json.cpp @@ -319,11 +319,11 @@ void parseAttachments(FacebookProto *proto, std::string *message_text, JSONNODE } } - if (!attachments_text.empty()) { - // TODO: have this as extra event, not replace or append message content - if (!message_text->empty()) - *message_text += "\n\n"; - + // TODO: have this as extra event, not replace or append message content + if (!message_text->empty()) + *message_text += "\n\n"; + + if (!attachments_text.empty()) { // we can't use this as offline messages doesn't have it /* JSONNODE *admin_snippet = json_get(it, "admin_snippet"); if (admin_snippet != NULL) { @@ -345,6 +345,9 @@ void parseAttachments(FacebookProto *proto, std::string *message_text, JSONNODE *message_text += ptrA(mir_utf8encodeT(title)); *message_text += attachments_text; + } else { + // TODO: better support for these attachments (parse it from "m_messaging" instead of "messaging" + *message_text += Translate("User sent you an unsupported attachment. Open your browser to actually see it.") } } } -- cgit v1.2.3