summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2012-06-26 16:44:31 +0000
committerRobert Pösel <robyer@seznam.cz>2012-06-26 16:44:31 +0000
commit26b12919bee626c835b693c9ee1749c1e9363055 (patch)
tree7f8db50b74b7cc385c635fee3dc9f0819a6c3ddf /protocols
parentb8d3c9870975ad6e7faf3f0e81705d0a6fcec8f5 (diff)
Facebook: Added hidden db key for use local timestamp for messages
git-svn-id: http://svn.miranda-ng.org/main/trunk@639 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/FacebookRM/db.h1
-rw-r--r--protocols/FacebookRM/process.cpp4
2 files changed, 4 insertions, 1 deletions
diff --git a/protocols/FacebookRM/db.h b/protocols/FacebookRM/db.h
index a58904fee5..74233f54f2 100644
--- a/protocols/FacebookRM/db.h
+++ b/protocols/FacebookRM/db.h
@@ -68,6 +68,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define FACEBOOK_KEY_TIMEOUTS_LIMIT "TimeoutsLimit" // [HIDDEN]
#define FACEBOOK_KEY_DISABLE_LOGOUT "DisableLogout" // [HIDDEN]
#define FACEBOOK_KEY_VALIDATE_RESPONSE "ValidateResponse" // [HIDDEN] - 0 = standard, 1 = always, 2 = never
+#define FACEBOOK_KEY_LOCAL_TIMESTAMP "UseLocalTimestamp" // [HIDDEN]
#define FACEBOOK_KEY_EVENT_NOTIFICATIONS_ENABLE "EventNotificationsEnable"
#define FACEBOOK_KEY_EVENT_FEEDS_ENABLE "EventFeedsEnable"
diff --git a/protocols/FacebookRM/process.cpp b/protocols/FacebookRM/process.cpp
index f8ffa7e1ce..c369585208 100644
--- a/protocols/FacebookRM/process.cpp
+++ b/protocols/FacebookRM/process.cpp
@@ -418,6 +418,8 @@ void FacebookProto::ProcessMessages( void* data )
p->parse_messages( data, &messages, &notifications );
delete p;
+ bool local_timestamp = getByte(FACEBOOK_KEY_LOCAL_TIMESTAMP, 0) != 0;
+
for(std::vector<facebook_message*>::size_type i=0; i<messages.size( ); i++)
{
if ( messages[i]->user_id != facy.self_.user_id )
@@ -436,7 +438,7 @@ void FacebookProto::ProcessMessages( void* data )
recv.flags = PREF_UTF;
recv.szMessage = const_cast<char*>(messages[i]->message_text.c_str());
- recv.timestamp = messages[i]->time;
+ recv.timestamp = local_timestamp ? ::time(NULL) : messages[i]->time;
ccs.hContact = hContact;
ccs.szProtoService = PSR_MESSAGE;