summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2014-11-21 16:58:54 +0000
committerRobert Pösel <robyer@seznam.cz>2014-11-21 16:58:54 +0000
commit29899d2b4101225fa6af52209be78018e3e09cc1 (patch)
treeaa24ffc8d55c53c938f82f7c00aba237d93df000 /protocols/FacebookRM
parentd8efddac06aa8b40f741d528bd815c6919a7fca9 (diff)
Facebook: Don't load history notifications into chatroom
git-svn-id: http://svn.miranda-ng.org/main/trunk@11031 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM')
-rw-r--r--protocols/FacebookRM/src/json.cpp5
1 files changed, 2 insertions, 3 deletions
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, "<a ", "href=\"", "\"");
notification->text = utils::text::remove_html(utils::text::source_get_value(&text, 1, "<abbr"));
- notification->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;