diff options
Diffstat (limited to 'protocols/FacebookRM/src/communication.cpp')
-rw-r--r-- | protocols/FacebookRM/src/communication.cpp | 124 |
1 files changed, 0 insertions, 124 deletions
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp index 6eb267b1e0..4caf79d536 100644 --- a/protocols/FacebookRM/src/communication.cpp +++ b/protocols/FacebookRM/src/communication.cpp @@ -1009,130 +1009,6 @@ bool facebook_client::reconnect() } } -bool facebook_client::buddy_list() -{ - handle_entry("buddy_list"); - - // Prepare update data - 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 += i->data->user_id + "%2C"; - } - } - - // Get buddy list - http::response resp = flap(REQUEST_BUDDY_LIST, &data); - - switch (resp.code) { - case HTTP_CODE_OK: - parent->ForkThread(&FacebookProto::ProcessBuddyList, new std::string(resp.data)); - return handle_success("buddy_list"); - - case HTTP_CODE_FAKE_ERROR: - case HTTP_CODE_FAKE_DISCONNECTED: - default: - return handle_error("buddy_list"); - } -} - -bool facebook_client::load_friends() -{ - handle_entry("load_friends"); - - // Get buddy list - http::response resp = flap(REQUEST_LOAD_FRIENDS); - - switch (resp.code) { - case HTTP_CODE_OK: - parent->ForkThread(&FacebookProto::ProcessFriendList, new std::string(resp.data)); - return handle_success("load_friends"); - - case HTTP_CODE_FAKE_ERROR: - case HTTP_CODE_FAKE_DISCONNECTED: - default: - return handle_error("load_friends"); - } -} - -bool facebook_client::feeds() -{ - handle_entry("feeds"); - - // Get feeds - http::response resp = flap(REQUEST_FEEDS); - - switch (resp.code) { - case HTTP_CODE_OK: - if (resp.data.find("\"num_stories\":0") == std::string::npos) - parent->ForkThread(&FacebookProto::ProcessFeeds, new std::string(resp.data)); - - return handle_success("feeds"); - - case HTTP_CODE_FAKE_ERROR: - case HTTP_CODE_FAKE_DISCONNECTED: - default: - return handle_error("feeds"); - } -} - -bool facebook_client::load_pages() -{ - if (!parent->getByte(FACEBOOK_KEY_LOAD_PAGES, DEFAULT_LOAD_PAGES)) - return true; - - handle_entry("load_pages"); - - // Get feeds - http::response resp = flap(REQUEST_PAGES); - - switch (resp.code) { - case HTTP_CODE_OK: - { - std::string content = utils::text::source_get_value(&resp.data, 2, "id=\"bookmarksSeeAllSection\"", "</code>"); - - std::string::size_type start, end; - start = content.find("<li", 0); - while (start != std::string::npos) { - end = content.find("<li", start+1); - if (end == std::string::npos) - end = content.length(); - - std::string item = content.substr(start, end - start); - //item = utils::text::source_get_value(&item, 2, "data-gt=", ">"); - - start = content.find("<li", start+1); - - std::string id = utils::text::source_get_value(&item, 3, "data-gt=", "bmid":"", """); - std::string title = utils::text::special_expressions_decode(utils::text::slashu_to_utf8(utils::text::source_get_value(&item, 3, "data-gt=", "title=\"", "\""))); - std::string href = utils::text::source_get_value(&item, 3, "data-gt=", "href=\"", "\""); - - // Ignore pages channel - if (href.find("/pages/feed") != std::string::npos) - continue; - - if (id.empty() || title.empty()) - continue; - - parent->debugLogA(" Got page: %s (%s)", title.c_str(), id.c_str()); - pages[id] = title; - } - - return handle_success("load_pages"); - } - case HTTP_CODE_FAKE_ERROR: - case HTTP_CODE_FAKE_DISCONNECTED: - default: - return handle_error("load_pages"); - } -} - bool facebook_client::channel() { handle_entry("channel"); |