diff options
author | Robert Pösel <robyer@seznam.cz> | 2016-07-05 17:58:47 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2016-07-05 17:58:47 +0000 |
commit | ec473b50196a5d04bd0fbcf67f465b5703b5138a (patch) | |
tree | a0032b99de071f70fb2ba225f9275365de2c10a3 /protocols/FacebookRM/src/json.cpp | |
parent | 21811cedec44836942fc07977634c868d9045cf5 (diff) |
Facebook: Prepare for showing reaction icons for notifications (needs support in Popup+ and YAPP)
git-svn-id: http://svn.miranda-ng.org/main/trunk@17061 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/json.cpp')
-rw-r--r-- | protocols/FacebookRM/src/json.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp index 376e5da431..c0c3e02845 100644 --- a/protocols/FacebookRM/src/json.cpp +++ b/protocols/FacebookRM/src/json.cpp @@ -135,6 +135,7 @@ int facebook_json_parser::parse_notifications(std::string *data, std::map< std:: const JSONNode &time_ = (*it)["timestamp"]["time"]; const JSONNode &text_ = (*it)["title"]["text"]; const JSONNode &url_ = (*it)["url"]; + const JSONNode &icon_ = (*it)["icon"]["uri"]; // Ignore empty and old notifications if (!text_ || !state_ || state_.as_string() == "SEEN_AND_READ" || !time_) @@ -152,6 +153,7 @@ int facebook_json_parser::parse_notifications(std::string *data, std::map< std:: notification->link = url_.as_string(); notification->text = utils::text::html_entities_decode(utils::text::slashu_to_utf8(text_.as_string())); notification->time = utils::time::from_string(time_.as_string()); + notification->setIcon(icon_.as_string()); // Write notification to chatroom proto->UpdateNotificationsChatRoom(notification); @@ -522,6 +524,7 @@ int facebook_json_parser::parse_messages(std::string *pData, std::vector<faceboo const JSONNode &text = text_["text"]; const JSONNode &url = (*itNodes)["url"]; const JSONNode &alert_id = (*itNodes)["alert_id"]; + const JSONNode &icon_ = (*itNodes)["icon"]["uri"]; const JSONNode &time_ = (*itNodes)["timestamp"]; if (!time_) @@ -540,6 +543,7 @@ int facebook_json_parser::parse_messages(std::string *pData, std::vector<faceboo notification->link = url.as_string(); notification->id = alert_id.as_string(); notification->time = timestamp; + notification->setIcon(icon_.as_string()); // Fix notification ID std::string::size_type pos = notification->id.find(":"); |