diff options
author | Robert Pösel <robyer@seznam.cz> | 2013-04-27 08:56:44 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2013-04-27 08:56:44 +0000 |
commit | e4b1413ff3fb8c169e2725c3e7686f47eaf93ec8 (patch) | |
tree | 5a7e4cf96f86b078930cbbb289d92b434565f86d /protocols/FacebookRM/src/communication.cpp | |
parent | af64eab612166b29df416b3f498a5ec1b7c08870 (diff) |
Facebook: Fixed getting offline messages.
Loading some timestamp value of contacts (dword "LastActiveTS") for... I don't know.
Version bump.
git-svn-id: http://svn.miranda-ng.org/main/trunk@4548 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/communication.cpp')
-rw-r--r-- | protocols/FacebookRM/src/communication.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp index fe8d53c121..48fc76e741 100644 --- a/protocols/FacebookRM/src/communication.cpp +++ b/protocols/FacebookRM/src/communication.cpp @@ -245,6 +245,7 @@ DWORD facebook_client::choose_security_level(int request_type) // case FACEBOOK_REQUEST_VISIBILITY:
// case FACEBOOK_REQUEST_TABS:
// case FACEBOOK_REQUEST_ASYNC:
+// case FACEBOOK_REQUEST_UNREAD_MESSAGES:
// case FACEBOOK_REQUEST_TYPING_SEND:
default:
return (DWORD)0;
@@ -282,6 +283,7 @@ int facebook_client::choose_method(int request_type) // case FACEBOOK_REQUEST_LOAD_FRIENDS:
// case FACEBOOK_REQUEST_LOAD_REQUESTS:
// case FACEBOOK_REQUEST_SEARCH:
+// case FACEBOOK_REQUEST_UNREAD_MESSAGES:
default:
return REQUEST_GET;
}
@@ -315,6 +317,7 @@ std::string facebook_client::choose_server(int request_type, std::string* data, case FACEBOOK_REQUEST_APPROVE_FRIEND:
case FACEBOOK_REQUEST_LOAD_REQUESTS:
case FACEBOOK_REQUEST_SEARCH:
+ case FACEBOOK_REQUEST_UNREAD_MESSAGES:
return FACEBOOK_SERVER_MOBILE;
// case FACEBOOK_REQUEST_LOGOUT:
@@ -383,6 +386,15 @@ std::string facebook_client::choose_action(int request_type, std::string* data, return action;
}
+ case FACEBOOK_REQUEST_UNREAD_MESSAGES:
+ {
+ std::string action = "/messages/?folder=unread";
+ if (get_data != NULL) {
+ action += *get_data;
+ }
+ return action;
+ }
+
case FACEBOOK_REQUEST_DELETE_FRIEND:
{
std::string action = "/ajax/profile/removefriendconfirm.php?__a=1";
@@ -820,7 +832,7 @@ bool facebook_client::chat_state(bool online) std::string data = (online ? "visibility=1" : "visibility=0");
data += "&window_id=0";
data += "&fb_dtsg=" + this->dtsg_;
- data += "&lsd=&phstamp=0&__user=" + self_.user_id;
+ data += "&phstamp=0&__user=" + self_.user_id;
http::response resp = flap(FACEBOOK_REQUEST_VISIBILITY, &data);
return handle_success("chat_state");
@@ -865,18 +877,16 @@ bool facebook_client::buddy_list() handle_entry("buddy_list");
// Prepare update data
- std::string data = "user=" + this->self_.user_id + "&fetch_mobile=true&fb_dtsg=" + this->dtsg_ + "&lsd=&__user=" + this->self_.user_id;
+ std::string data = "user=" + this->self_.user_id + "&fetch_mobile=true&phstamp=0&fb_dtsg=" + this->dtsg_ + "&__user=" + this->self_.user_id;
{
ScopedLock s(buddies_lock_);
+ data += "&cached_user_info_ids=";
int counter = 0;
for (List::Item< facebook_user >* i = buddies.begin(); i != NULL; i = i->next, counter++)
{
- data += "&available_user_info_ids[";
- data += utils::conversion::to_string(&counter, UTILS_CONV_UNSIGNED_NUMBER);
- data += "]=";
- data += i->data->user_id;
+ data += i->data->user_id + "%2C";
}
}
|