summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/process.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2017-01-22 22:31:24 +0100
committerRobert Pösel <robyer@seznam.cz>2017-01-22 22:31:24 +0100
commit6dd71dba3863c45c72d9c3bfd408f969bbb33a75 (patch)
tree043b9e42aacdc5d862e7ddc392c96a12e15c83e9 /protocols/FacebookRM/src/process.cpp
parentea70f07b4e6de61e75b4da821e7c93c6f3abdeea (diff)
Facebook: Fix searching (by name/email/...)
Diffstat (limited to 'protocols/FacebookRM/src/process.cpp')
-rw-r--r--protocols/FacebookRM/src/process.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp
index 600dc5a952..6b1d126a7e 100644
--- a/protocols/FacebookRM/src/process.cpp
+++ b/protocols/FacebookRM/src/process.cpp
@@ -1212,15 +1212,16 @@ void FacebookProto::SearchAckThread(void *targ)
std::string search = utils::url::encode(T2Utf((wchar_t *)targ).str());
std::string ssid;
+ int pn = 1;
while (count < 50 && !isOffline())
{
- SearchRequest *request = new SearchRequest(facy.mbasicWorks, search.c_str(), count, ssid.c_str());
+ SearchRequest *request = new SearchRequest(facy.mbasicWorks, search.c_str(), count, pn, ssid.c_str());
http::response resp = facy.sendRequest(request);
if (resp.code == HTTP_CODE_OK)
{
- std::string items = utils::text::source_get_value(&resp.data, 4, "<body", "name=\"charset_test\"", "<table", "</body>");
+ std::string items = utils::text::source_get_value(&resp.data, 4, "<body", "</form", "<table", "</body>");
std::string::size_type pos = 0;
std::string::size_type pos2 = 0;
@@ -1270,9 +1271,13 @@ void FacebookProto::SearchAckThread(void *targ)
}
ssid = utils::text::source_get_value(&items, 3, "id=\"more_objects\"", "ssid=", "&");
+ pn++; // increment page number
if (ssid.empty())
break; // No more results
}
+ else {
+ break;
+ }
}
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, targ, 0);