diff options
author | Robert Pösel <robyer@seznam.cz> | 2014-11-17 15:21:14 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2014-11-17 15:21:14 +0000 |
commit | 5507917da919d55aad972f8331a11da8f721f786 (patch) | |
tree | cd872fcc4bd657d67e7aef905920c0c12c9652a4 /protocols/FacebookRM | |
parent | 926a719ab7c2ae9e8205a396540eb429bf2637ff (diff) |
Facebook: Show "Message read ..." info always in local time
git-svn-id: http://svn.miranda-ng.org/main/trunk@11004 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM')
-rw-r--r-- | protocols/FacebookRM/src/json.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp index c8e69e91b7..2162ed0021 100644 --- a/protocols/FacebookRM/src/json.cpp +++ b/protocols/FacebookRM/src/json.cpp @@ -441,12 +441,12 @@ int facebook_json_parser::parse_messages(void* data, std::vector< facebook_messa if (reader == NULL || time == NULL) continue; - // check if we should use use local_timestamp for unread messages and use it for read time too - bool local_timestamp = proto->getBool(FACEBOOK_KEY_LOCAL_TIMESTAMP_UNREAD, 0); - time_t timestamp = local_timestamp ? ::time(NULL) : utils::time::fix_timestamp(json_as_float(time)); + // 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, 0); + time_t timestamp = local_timestamp ? ::time(NULL) : utils::time::fix_timestamp(json_as_float(time));*/ - TCHAR ttime[64]; - _tcsftime(ttime, SIZEOF(ttime), _T("%X"), localtime(×tamp)); + // we can always use NOW for read time, because that's the time of receiving this event (+-) + time_t timestamp = ::time(NULL); JSONNODE *threadid = json_get(it, "tid"); if (threadid != NULL) { // multi user chat @@ -480,6 +480,9 @@ int facebook_json_parser::parse_messages(void* data, std::vector< facebook_messa st.cbSize = sizeof(st); st.hIcon = Skin_GetIconByHandle(GetIconHandle("read")); + TCHAR ttime[64]; + _tcsftime(ttime, SIZEOF(ttime), _T("%X"), localtime(×tamp)); + mir_sntprintf(st.tszText, SIZEOF(st.tszText), TranslateT("Message read: %s by %s"), ttime, readers); CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hChatContact, (LPARAM)&st); |