summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/json.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2014-12-23 15:30:02 +0000
committerRobert Pösel <robyer@seznam.cz>2014-12-23 15:30:02 +0000
commit2cd071fd8de860655b981d22ecac139cd6e4411b (patch)
treec6a498931e92b126076ad98af0205543c108af62 /protocols/FacebookRM/src/json.cpp
parent716eea6998bf896c6180d1ef42bbc7ef9406729d (diff)
Facebook: Remove support for "use local timestamp for messages"
It's not needed anymore because we correctly set server time for sent messages, so everything will be consistent (in server time) git-svn-id: http://svn.miranda-ng.org/main/trunk@11598 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/json.cpp')
-rw-r--r--protocols/FacebookRM/src/json.cpp17
1 files changed, 3 insertions, 14 deletions
diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp
index 369f94c31f..701b88f633 100644
--- a/protocols/FacebookRM/src/json.cpp
+++ b/protocols/FacebookRM/src/json.cpp
@@ -240,9 +240,6 @@ int facebook_json_parser::parse_notifications(std::string *data, std::map< std::
return EXIT_FAILURE;
}
- // check if we should use use local_timestamp for unread messages and use it for notifications time too
- bool local_timestamp = proto->getBool(FACEBOOK_KEY_LOCAL_TIMESTAMP_UNREAD, 0);
-
// Create notifications chatroom (if it doesn't exists), because we will be writing to it new notifications here
proto->PrepareNotificationsChatRoom();
@@ -265,7 +262,7 @@ int facebook_json_parser::parse_notifications(std::string *data, std::map< std::
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->time = local_timestamp ? ::time(NULL) : utils::time::fix_timestamp(json_as_float(time));
+ notification->time = utils::time::fix_timestamp(json_as_float(time));
// Write notification to chatroom
proto->UpdateNotificationsChatRoom(notification);
@@ -445,12 +442,7 @@ int facebook_json_parser::parse_messages(std::string *data, std::vector< faceboo
if (reader == NULL || time == NULL)
continue;
- // check if we should use use local_timestamp for incoming messages and use it for read time too
- /*bool local_timestamp = proto->getBool(FACEBOOK_KEY_LOCAL_TIMESTAMP, DEFAULT_LOCAL_TIME);
- time_t timestamp = local_timestamp ? ::time(NULL) : utils::time::fix_timestamp(json_as_float(time));*/
-
- // we can always use NOW for read time, because that's the time of receiving this event (+-)
- time_t timestamp = ::time(NULL);
+ time_t timestamp = utils::time::fix_timestamp(json_as_float(time));
JSONNODE *threadid = json_get(it, "tid");
if (threadid != NULL) { // multi user chat
@@ -576,9 +568,6 @@ int facebook_json_parser::parse_messages(std::string *data, std::vector< faceboo
// event notification
JSONNODE *nodes = json_get(it, "nodes");
- // check if we should use use local_timestamp for unread messages and use it for notifications time too
- bool local_timestamp = proto->getBool(FACEBOOK_KEY_LOCAL_TIMESTAMP_UNREAD, 0);
-
// Create notifications chatroom (if it doesn't exists), because we will be writing to it new notifications here
proto->PrepareNotificationsChatRoom();
@@ -609,7 +598,7 @@ int facebook_json_parser::parse_messages(std::string *data, std::vector< faceboo
notification->text = utils::text::slashu_to_utf8(json_as_pstring(text));
notification->link = json_as_pstring(url);
notification->id = json_as_pstring(alert_id);
- notification->time = local_timestamp ? ::time(NULL) : utils::time::fix_timestamp(timestamp);
+ notification->time = utils::time::fix_timestamp(timestamp);
std::string::size_type pos = notification->id.find(":");
if (pos != std::string::npos)