From b330de2b0bcf4d09a417c0ef154c3419b6930316 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Mon, 20 May 2013 13:26:29 +0000 Subject: Facebook: Marking notifications as read with right click on popup. git-svn-id: http://svn.miranda-ng.org/main/trunk@4760 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/json.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'protocols/FacebookRM/src/json.cpp') diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp index 2482819bf1..67eb807346 100644 --- a/protocols/FacebookRM/src/json.cpp +++ b/protocols/FacebookRM/src/json.cpp @@ -237,7 +237,6 @@ int facebook_json_parser::parse_notifications(void *data, std::vector< facebook_ const Object::Member& member = *payload_item; const Object& objMember = member.element; - const String& content = objMember["markup"]; const Number& unread = objMember["unread"]; @@ -251,6 +250,7 @@ int facebook_json_parser::parse_notifications(void *data, std::vector< facebook_ notification->text = utils::text::remove_html(utils::text::source_get_value(&text, 1, "link = utils::text::source_get_value(&text, 3, "id = member.name; notifications->push_back(notification); } @@ -453,15 +453,19 @@ int facebook_json_parser::parse_messages(void* data, std::vector< facebook_messa //const String& text = objNotification["title"]["text"]; const String& text = objNotification["unaggregatedTitle"]["text"]; const String& link = objNotification["url"]; + const String& id = objNotification["alert_id"]; const Number& time_sent = objNotification["timestamp"]["time"]; - if (time_sent.Value() > proto->facy.last_notification_time_) // Check agains duplicit notifications + if (time_sent.Value() > proto->facy.last_notification_time_) // Check against duplicit notifications { proto->facy.last_notification_time_ = time_sent.Value(); facebook_notification* notification = new facebook_notification(); notification->text = utils::text::slashu_to_utf8(text.Value()); notification->link = utils::text::special_expressions_decode(link.Value()); + + std::string::size_type pos = id.Value().find(":"); + notification->id = (pos != std::string::npos) ? id.Value().substr(pos+1) : id.Value(); notifications->push_back(notification); } -- cgit v1.2.3