summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/json.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2013-11-27 18:53:57 +0000
committerRobert Pösel <robyer@seznam.cz>2013-11-27 18:53:57 +0000
commitab1971b510fb004fc23aa3a69565ce69d8d0743e (patch)
tree10ee083ade2860980eac8c162dfe6a7927ece072 /protocols/FacebookRM/src/json.cpp
parent4859c7f947362a2fd8d4b9dc0458168fcb7143e7 (diff)
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
Diffstat (limited to 'protocols/FacebookRM/src/json.cpp')
-rw-r--r--protocols/FacebookRM/src/json.cpp10
1 files changed, 9 insertions, 1 deletions
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;