diff options
author | Robert Pösel <robyer@seznam.cz> | 2014-11-17 22:23:42 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2014-11-17 22:23:42 +0000 |
commit | 989fa6c77d1b8fd1b9dc412b6948947cf5b170cb (patch) | |
tree | d27341054c2f5ea2f8415d4202166341f3aa12f6 /protocols/FacebookRM/src/communication.cpp | |
parent | 6029781c4a2ca30552d96de331a640c653d8bfba (diff) |
Facebook: Experimental messages sync at login (for last 24-hours only) (patch by Vojtěch Kinkor, thanks)
git-svn-id: http://svn.miranda-ng.org/main/trunk@11006 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/communication.cpp')
-rw-r--r-- | protocols/FacebookRM/src/communication.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp index 053ed0c0e4..11c4e066d8 100644 --- a/protocols/FacebookRM/src/communication.cpp +++ b/protocols/FacebookRM/src/communication.cpp @@ -238,6 +238,7 @@ DWORD facebook_client::choose_security_level(RequestType request_type) // case REQUEST_MESSAGE_SEND_CHAT: // case REQUEST_MESSAGE_SEND_INBOX: // case REQUEST_THREAD_INFO: +// case REQUEST_THREAD_SYNC: // case REQUEST_MESSAGES_RECEIVE: // case REQUEST_VISIBILITY: // case REQUEST_POKE: @@ -264,6 +265,7 @@ int facebook_client::choose_method(RequestType request_type) case REQUEST_MESSAGE_SEND_CHAT: case REQUEST_MESSAGE_SEND_INBOX: case REQUEST_THREAD_INFO: + case REQUEST_THREAD_SYNC: case REQUEST_VISIBILITY: case REQUEST_POKE: case REQUEST_ASYNC: @@ -341,6 +343,7 @@ std::string facebook_client::choose_server(RequestType request_type, std::string // case REQUEST_MESSAGE_SEND_CHAT: // case REQUEST_MESSAGE_SEND_INBOX: // case REQUEST_THREAD_INFO: +// case REQUEST_THREAD_SYNC: // case REQUEST_VISIBILITY: // case REQUEST_POKE: // case REQUEST_ASYNC: @@ -520,6 +523,9 @@ std::string facebook_client::choose_action(RequestType request_type, std::string case REQUEST_THREAD_INFO: return "/ajax/mercury/thread_info.php?__a=1"; + case REQUEST_THREAD_SYNC: + return "/ajax/mercury/thread_sync.php"; + case REQUEST_MESSAGES_RECEIVE: { std::string action = "/pull?channel=" + (this->chat_channel_.empty() ? "p_" + self_.user_id : this->chat_channel_); @@ -1315,6 +1321,11 @@ int facebook_client::send_message(MCONTACT hContact, std::string message_recipie if (mid.empty()) mid = utils::text::source_get_value(&resp.data, 2, "\"mid\":\"", "\""); parent->setString(hContact, FACEBOOK_KEY_MESSAGE_ID, mid.c_str()); + + // Remember last action timestamp + std::string timestamp = utils::text::source_get_value(&resp.data, 2, "\"timestamp\":", ","); + parent->setString(FACEBOOK_KEY_LAST_ACTION_TIMESTAMP, timestamp.c_str()); + messages_ignore.insert(std::make_pair(mid, 0)); } break; |