diff options
author | Robert Pösel <robyer@seznam.cz> | 2013-05-20 13:26:29 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2013-05-20 13:26:29 +0000 |
commit | b330de2b0bcf4d09a417c0ef154c3419b6930316 (patch) | |
tree | 962eb53ad945a1a26204f4f2d738bb94354d3d2b /protocols/FacebookRM/src/json.cpp | |
parent | 7e065653a2ffe78094357f6838a5c15ac0fda885 (diff) |
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
Diffstat (limited to 'protocols/FacebookRM/src/json.cpp')
-rw-r--r-- | protocols/FacebookRM/src/json.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
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, "<abbr"));
notification->link = utils::text::source_get_value(&text, 3, "<a ", "href=\"", "\"");
+ notification->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);
}
|