diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-04-14 20:11:54 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-04-14 20:11:54 (GMT) |
| commit | 900e23128a16bd49d8929a232ac57fc7e30ad3f9 (patch) | |
| tree | a5d04c86dc0ac5efb887579699e86143f12f20a8 /src/client/Client.cpp | |
| parent | 4c6be4ff2cc822d9c1ed36c9c88261771775dc02 (diff) | |
| download | powder-900e23128a16bd49d8929a232ac57fc7e30ad3f9.zip powder-900e23128a16bd49d8929a232ac57fc7e30ad3f9.tar.gz | |
Add ability to get favourites
Diffstat (limited to 'src/client/Client.cpp')
| -rw-r--r-- | src/client/Client.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/client/Client.cpp b/src/client/Client.cpp index 2d65677..9e4732b 100644 --- a/src/client/Client.cpp +++ b/src/client/Client.cpp @@ -840,7 +840,7 @@ std::vector<Comment*> * Client::GetComments(int saveID, int start, int count) return commentArray; } -std::vector<Save*> * Client::SearchSaves(int start, int count, string query, string sort, bool showOwn, int & resultCount) +std::vector<Save*> * Client::SearchSaves(int start, int count, string query, string sort, std::string category, int & resultCount) { lastError = ""; resultCount = 0; @@ -860,15 +860,21 @@ std::vector<Save*> * Client::SearchSaves(int start, int count, string query, str urlStream << URLEscape(" "); urlStream << URLEscape("sort:") << URLEscape(sort); } - if(showOwn && authUser.ID) - { - if(query.length()) - urlStream << URLEscape(" "); - urlStream << URLEscape("user:") << URLEscape(authUser.Username); - } - } - data = http_simple_get((char *)urlStream.str().c_str(), &dataStatus, &dataLength); + if(category.length()) + { + urlStream << "&Category=" << URLEscape(category); + } + if(authUser.ID) + { + std::stringstream userIDStream; + userIDStream << authUser.ID; + data = http_auth_get((char *)urlStream.str().c_str(), (char *)(userIDStream.str().c_str()), NULL, (char *)(authUser.SessionID.c_str()), &dataStatus, &dataLength); + } + else + { + data = http_simple_get((char *)urlStream.str().c_str(), &dataStatus, &dataLength); + } if(dataStatus == 200 && data) { try |
