diff options
author | George Hazan <ghazan@miranda.im> | 2018-01-08 20:15:22 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-01-08 20:15:22 +0300 |
commit | 968eceb522b9dc380a4922e2f6b08857dec83bf4 (patch) | |
tree | 62214fa8eb79b103dd1703740189d50e98c128cf /protocols/FacebookRM/src/feeds.cpp | |
parent | 1c6bcb36c8b19d6a40e23dc9a71944e48bb67295 (diff) |
Facebook: less RTTI, less useless data
Diffstat (limited to 'protocols/FacebookRM/src/feeds.cpp')
-rw-r--r-- | protocols/FacebookRM/src/feeds.cpp | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/protocols/FacebookRM/src/feeds.cpp b/protocols/FacebookRM/src/feeds.cpp index 9e94c57f6e..b4bda2d578 100644 --- a/protocols/FacebookRM/src/feeds.cpp +++ b/protocols/FacebookRM/src/feeds.cpp @@ -23,24 +23,28 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "stdafx.h" // getting newsfeed posts -NewsfeedRequest::NewsfeedRequest(facebook_client *fc) : - HttpRequest(REQUEST_GET, FACEBOOK_SERVER_REGULAR "/ajax/home/generic.php") +HttpRequest* facebook_client::newsfeedRequest() { - BYTE feed_type = fc->parent->getByte(FACEBOOK_KEY_FEED_TYPE, 0); + HttpRequest *p = new HttpRequest(REQUEST_GET, FACEBOOK_SERVER_REGULAR "/ajax/home/generic.php"); + + BYTE feed_type = parent->getByte(FACEBOOK_KEY_FEED_TYPE, 0); if (feed_type >= _countof(feed_types)) feed_type = 0; - Url + p->Url << CHAR_PARAM("sk", feed_types[feed_type].id) << CHAR_PARAM("key", (feed_type < 2) ? "nf" : feed_types[feed_type].id) - << CHAR_PARAM("__user", fc->self_.user_id.c_str()) + << CHAR_PARAM("__user", self_.user_id.c_str()) << INT_PARAM("__a", 1); + + return p; } -MemoriesRequest::MemoriesRequest(facebook_client *fc) : - HttpRequest(REQUEST_GET, FACEBOOK_SERVER_REGULAR "/onthisday/story/query/") +HttpRequest* facebook_client::memoriesRequest() { - Url + HttpRequest * p = new HttpRequest(REQUEST_GET, FACEBOOK_SERVER_REGULAR "/onthisday/story/query/"); + + p->Url << INT_PARAM("__a", 1) << INT_PARAM("start_index", 0) << INT_PARAM("num_stories", 20) @@ -49,8 +53,10 @@ MemoriesRequest::MemoriesRequest(facebook_client *fc) : << INT_PARAM("__be", -1) << CHAR_PARAM("__pc", "PHASED:DEFAULT") << INT64_PARAM("timestamp", ::time(nullptr)) - << CHAR_PARAM("__dyn", fc->__dyn()) - << CHAR_PARAM("__req", fc->__req()) - << CHAR_PARAM("__rev", fc->__rev()) - << CHAR_PARAM("__user", fc->self_.user_id.c_str()); + << CHAR_PARAM("__dyn", __dyn()) + << CHAR_PARAM("__req", __req()) + << CHAR_PARAM("__rev", __rev()) + << CHAR_PARAM("__user", self_.user_id.c_str()); + + return p; } |