From ab1971b510fb004fc23aa3a69565ce69d8d0743e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Wed, 27 Nov 2013 18:53:57 +0000 Subject: Facebook: - fixed marking messages of some multichats as read (fixes #504) - fixed downloading avatars of some contacts (and repeated downloading of them again and again...) - load messages marked as abusive/spam - version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@6996 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/json.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'protocols/FacebookRM/src/json.cpp') diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp index 84e7b46abf..cbb18c66e1 100644 --- a/protocols/FacebookRM/src/json.cpp +++ b/protocols/FacebookRM/src/json.cpp @@ -458,6 +458,7 @@ int facebook_json_parser::parse_messages(void* data, std::vector< facebook_messa JSONNODE *tid = json_get(msg, "tid"); JSONNODE *mid = json_get(msg, "mid"); JSONNODE *timestamp = json_get(msg, "timestamp"); + JSONNODE *filtered = json_get(it, "is_filtered_content"); if (sender_fbid == NULL || sender_name == NULL || body == NULL || mid == NULL || timestamp == NULL) continue; @@ -477,6 +478,9 @@ int facebook_json_parser::parse_messages(void* data, std::vector< facebook_messa if (body == NULL || ignore_duplicits(proto, message_id, message_text)) continue; + if (json_as_bool(filtered) && message_text.empty()) + message_text = Translate("This message is no longer available, because it was marked as abusive or spam."); + message_text = utils::text::trim(utils::text::special_expressions_decode(utils::text::slashu_to_utf8(message_text)), true); if (message_text.empty()) continue; @@ -835,9 +839,10 @@ int facebook_json_parser::parse_thread_messages(void* data, std::vector< faceboo JSONNODE *tid = json_get(it, "thread_id"); JSONNODE *mid = json_get(it, "message_id"); JSONNODE *timestamp = json_get(it, "timestamp"); + JSONNODE *filtered = json_get(it, "is_filtered_content"); if (author == NULL || body == NULL || mid == NULL || tid == NULL || timestamp == NULL) - continue; + continue; std::string thread_id = json_as_pstring(tid); std::string message_id = json_as_pstring(mid); @@ -850,6 +855,9 @@ int facebook_json_parser::parse_thread_messages(void* data, std::vector< faceboo // Process attachements and stickers parseAttachments(proto, &message_text, it); + if (json_as_bool(filtered) && message_text.empty()) + message_text = Translate("This message is no longer available, because it was marked as abusive or spam."); + message_text = utils::text::trim(utils::text::special_expressions_decode(utils::text::slashu_to_utf8(message_text)), true); if (message_text.empty()) continue; -- cgit v1.2.3