From 29899d2b4101225fa6af52209be78018e3e09cc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Fri, 21 Nov 2014 16:58:54 +0000 Subject: Facebook: Don't load history notifications into chatroom git-svn-id: http://svn.miranda-ng.org/main/trunk@11031 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/json.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'protocols/FacebookRM/src') diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp index 8c0de1bd22..98ac75790f 100644 --- a/protocols/FacebookRM/src/json.cpp +++ b/protocols/FacebookRM/src/json.cpp @@ -262,7 +262,7 @@ int facebook_json_parser::parse_notifications(void *data, std::map< std::string, JSONNODE *time = json_get(it, "time"); // Ignore empty and old notifications - if (markup == NULL || unread == NULL || time == NULL) + if (markup == NULL || unread == NULL || time == NULL || json_as_int(unread) == 0) continue; std::string text = utils::text::html_entities_decode(utils::text::slashu_to_utf8(json_as_pstring(markup))); @@ -272,14 +272,13 @@ int facebook_json_parser::parse_notifications(void *data, std::map< std::string, notification->id = id; notification->link = utils::text::source_get_value(&text, 3, "text = utils::text::remove_html(utils::text::source_get_value(&text, 1, "seen = (json_as_int(unread) == 0); notification->time = local_timestamp ? ::time(NULL) : utils::time::fix_timestamp(json_as_float(time)); // Write notification to chatroom proto->UpdateNotificationsChatRoom(notification); // If it's unseen, remember it, otherwise forget it - if (notifications->find(notification->id) == notifications->end() && !notification->seen) + if (notifications->find(notification->id) == notifications->end()) notifications->insert(std::make_pair(notification->id, notification)); else delete notification; -- cgit v1.2.3