summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/utils.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2012-05-24 15:40:11 +0000
committerRobert Pösel <robyer@seznam.cz>2012-05-24 15:40:11 +0000
commit73d90fba8c5a90e1195481efa7e59535cf156413 (patch)
tree5a840a24e5f5da25fbc30921d01fae2c31b6adb3 /protocols/FacebookRM/utils.cpp
parentf78628ed14bc7aa0fd3a7e10c5cb25c71e7748db (diff)
Update for Facebook RM (processing friend requests, searching support,...)
git-svn-id: http://svn.miranda-ng.org/main/trunk@164 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/utils.cpp')
-rw-r--r--protocols/FacebookRM/utils.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/protocols/FacebookRM/utils.cpp b/protocols/FacebookRM/utils.cpp
index 5440757450..248bb432bd 100644
--- a/protocols/FacebookRM/utils.cpp
+++ b/protocols/FacebookRM/utils.cpp
@@ -58,6 +58,24 @@ std::string utils::time::mili_timestamp( )
return timestamp;
}
+DWORD utils::time::fix_timestamp( double mili_timestamp )
+{
+ // If it is really mili_timestamp
+ if (mili_timestamp > 100000000000) {
+ return (DWORD) (mili_timestamp / 1000);
+ }
+ return (DWORD) mili_timestamp;
+}
+
+DWORD utils::conversion::to_timestamp( std::string data )
+{
+ DWORD timestamp = NULL;
+ if (!utils::conversion::from_string<DWORD>(timestamp, data, std::dec)) {
+ timestamp = static_cast<DWORD>(::time(NULL));
+ }
+ return timestamp;
+}
+
std::string utils::conversion::to_string( void* data, WORD type )
{
std::stringstream out;