From 73ce939948a8ed16495db7999d34c2dafee5f390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Sat, 30 May 2015 22:05:17 +0000 Subject: Facebook: Remove useless parameter git-svn-id: http://svn.miranda-ng.org/main/trunk@13917 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/client.h | 2 +- protocols/FacebookRM/src/communication.cpp | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'protocols') diff --git a/protocols/FacebookRM/src/client.h b/protocols/FacebookRM/src/client.h index 0f9853ca26..fa3f11db09 100644 --- a/protocols/FacebookRM/src/client.h +++ b/protocols/FacebookRM/src/client.h @@ -203,7 +203,7 @@ public: // HTTP communication - http::response flap(RequestType request_type, std::string *post_data = NULL, std::string *get_data = NULL, int method = 0); + http::response flap(RequestType request_type, std::string *post_data = NULL, std::string *get_data = NULL); bool save_url(const std::string &url,const std::tstring &filename, HANDLE &nlc); bool notify_errors(RequestType); diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp index 009b277417..4de82524ba 100644 --- a/protocols/FacebookRM/src/communication.cpp +++ b/protocols/FacebookRM/src/communication.cpp @@ -27,7 +27,7 @@ void facebook_client::client_notify(TCHAR* message) parent->NotifyEvent(parent->m_tszUserName, message, NULL, FACEBOOK_EVENT_CLIENT); } -http::response facebook_client::flap(RequestType request_type, std::string *post_data, std::string *get_data, int) +http::response facebook_client::flap(RequestType request_type, std::string *post_data, std::string *get_data) { http::response resp; @@ -375,10 +375,15 @@ std::string facebook_client::choose_action(RequestType request_type, std::string case REQUEST_NOTIFICATIONS: { - std::string action = "/ajax/notifications/get.php?__a=1&user=%s&time=0&version=2&__user=%s"; - // TODO: use better format notifications request - // std::string action = "/ajax/notifications/client/get.php?__a=1&user=%s&time=0&version=2&__user=%s"; - utils::text::replace_all(&action, "%s", self_.user_id); + // __req=5 .. počítá počet všech různých požadavků (asi možná jen na /ajax/...) + + std::string action = "/ajax/notifications/client/get.php?__a=1&__dyn=&__req=&__rev="; + action += "&__user=" + this->self_.user_id; + action += "&fb_dtsg=" + this->dtsg_; + action += "&cursor="; // when loading more + action += "&length=15"; // number of items to load + action += "&businessID="; // probably for pages? idk + action += "&ttstamp=" + ttstamp(); return action; } @@ -758,7 +763,7 @@ bool facebook_client::login(const char *username, const char *password) // Check whether setting Machine name is required if (location.find("/checkpoint/") != std::string::npos) { - resp = flap(REQUEST_SETUP_MACHINE, NULL, NULL, REQUEST_GET); + resp = flap(REQUEST_SETUP_MACHINE, NULL, NULL); if (resp.data.find("login_approvals_no_phones") != std::string::npos) { // Code approval - but no phones in account -- cgit v1.2.3