From dde6b53e4487b85be6194126698a8cffbe95651f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Tue, 4 Oct 2016 03:43:12 +0000 Subject: Facebook: Potential fix for searching by username/id git-svn-id: http://svn.miranda-ng.org/main/trunk@17348 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/process.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'protocols') diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp index 4685d3cdcd..d67fedddbf 100644 --- a/protocols/FacebookRM/src/process.cpp +++ b/protocols/FacebookRM/src/process.cpp @@ -1363,7 +1363,7 @@ void FacebookProto::SearchIdAckThread(void *targ) { facy.handle_entry("searchIdAckThread"); - std::string search = utils::url::encode(T2Utf((wchar_t*)targ).str()) + "?"; + std::string search = utils::url::encode(T2Utf((wchar_t*)targ).str()); if (!isOffline()) { @@ -1371,7 +1371,7 @@ void FacebookProto::SearchIdAckThread(void *targ) http::response resp = facy.sendRequest(request); if (resp.code == HTTP_CODE_FOUND && resp.headers.find("Location") != resp.headers.end()) { - search = utils::text::source_get_value(&resp.headers["Location"], 2, FACEBOOK_SERVER_MBASIC"/", "_rdr", true); + search = utils::text::source_get_value(&resp.headers["Location"], 2, FACEBOOK_SERVER_MBASIC"/", "_rdr"); HttpRequest *request = new ProfileRequest(facy.mbasicWorks, search.c_str()); http::response resp = facy.sendRequest(request); @@ -1379,12 +1379,15 @@ void FacebookProto::SearchIdAckThread(void *targ) if (resp.code == HTTP_CODE_OK) { - std::string about = utils::text::source_get_value(&resp.data, 2, "
"); + std::string about = utils::text::source_get_value(&resp.data, 2, "id=\"root\"", ""); std::string id = utils::text::source_get_value2(&about, ";id=", "&\""); if (id.empty()) id = utils::text::source_get_value2(&about, "?bid=", "&\""); std::string name = utils::text::source_get_value(&about, 3, "", "", ""); + } std::string surname; std::string::size_type pos; -- cgit v1.2.3