diff options
author | Robert Pösel <robyer@seznam.cz> | 2016-10-04 03:43:12 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2016-10-04 03:43:12 +0000 |
commit | dde6b53e4487b85be6194126698a8cffbe95651f (patch) | |
tree | a94ff1084fd892838c99787c879f4b82c9af9508 /protocols/FacebookRM | |
parent | 0976190894d653d5062f8ef6befabf46218f2d24 (diff) |
Facebook: Potential fix for searching by username/id
git-svn-id: http://svn.miranda-ng.org/main/trunk@17348 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM')
-rw-r--r-- | protocols/FacebookRM/src/process.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
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, "<div id=\"root\"", "</body>"); + std::string about = utils::text::source_get_value(&resp.data, 2, "id=\"root\"", "</body>"); 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, "<strong", ">", "</strong"); + if (name.empty()) { + name = utils::text::source_get_value(&resp.data, 2, "<title>", "</title>"); + } std::string surname; std::string::size_type pos; |