diff options
author | Robert Pösel <robyer@seznam.cz> | 2012-05-24 15:40:11 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2012-05-24 15:40:11 +0000 |
commit | 73d90fba8c5a90e1195481efa7e59535cf156413 (patch) | |
tree | 5a840a24e5f5da25fbc30921d01fae2c31b6adb3 /protocols/FacebookRM/json.cpp | |
parent | f78628ed14bc7aa0fd3a7e10c5cb25c71e7748db (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/json.cpp')
-rw-r--r-- | protocols/FacebookRM/json.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/protocols/FacebookRM/json.cpp b/protocols/FacebookRM/json.cpp index 4293f336f9..2231596882 100644 --- a/protocols/FacebookRM/json.cpp +++ b/protocols/FacebookRM/json.cpp @@ -288,7 +288,7 @@ int facebook_json_parser::parse_messages( void* data, std::vector< facebook_mess const String& text = messageContent["text"];
//"tab_type":"friend", objMember["tab_type"]
- //const Number& time_sent = messageContent["time"];
+ const Number& time_sent = messageContent["time"];
// proto->Log("????? Checking time %15.2f > %15.2f", time_sent.Value(), proto->facy.last_message_time_);
if ((messageContent.Find("truncated") != messageContent.End())
@@ -299,11 +299,10 @@ int facebook_json_parser::parse_messages( void* data, std::vector< facebook_mess proto->Log(msg.c_str());
} else if (last_msg != text.Value()) {
last_msg = text.Value();
-
facebook_message* message = new facebook_message( );
message->message_text = utils::text::special_expressions_decode(
utils::text::slashu_to_utf8( text.Value( ) ) );
- message->time = ::time( NULL ); // TODO: use real time from facebook
+ message->time = utils::time::fix_timestamp( time_sent.Value() );
message->user_id = was_id;
messages->push_back( message );
@@ -337,8 +336,7 @@ int facebook_json_parser::parse_messages( void* data, std::vector< facebook_mess std::string row = ((const String &)objMember["thread_row"]).Value();
- //const Number& time_sent = messageContent["timestamp"];
-
+ const Number& time_sent = messageContent["timestamp"];
//proto->Log("????? Checking time %15.2f > %15.2f", time_sent.Value(), proto->facy.last_message_time_);
if (last_msg != text.Value()) {
@@ -351,7 +349,7 @@ int facebook_json_parser::parse_messages( void* data, std::vector< facebook_mess message->sender_name = utils::text::special_expressions_decode(
utils::text::slashu_to_utf8( sender_name.Value( ) ) );
- message->time = ::time( NULL ); // TODO: user real time from facebook
+ message->time = utils::time::fix_timestamp( time_sent.Value() );
message->user_id = was_id; // TODO: Check if we have contact with this ID in friendlist and then do something different?
if (row.find("uiSplitPic",0) != std::string::npos) {
@@ -421,8 +419,11 @@ int facebook_json_parser::parse_messages( void* data, std::vector< facebook_mess if (!proto->IsChatContact(group_id, was_id))
proto->AddChatContact(group_id, was_id, name.c_str());
+ const Number& time_sent = messageContent["time"];
+ DWORD timestamp = utils::time::fix_timestamp( time_sent.Value() );
+
// Add message into chat
- proto->UpdateChat(group_id, was_id, name.c_str(), msg.c_str());
+ proto->UpdateChat(group_id, was_id, name.c_str(), msg.c_str(), timestamp);
}
else if ( type.Value( ) == "thread_msg" ) // multiuser message
{
|