HaikuDepot: Added captcha request to WebAppInterface
Also removed some disabled debug output.
This commit is contained in:
@@ -277,8 +277,6 @@ WebAppInterface::RetrievePackageInfo(const BString& packageName,
|
||||
.EndArray()
|
||||
.End();
|
||||
|
||||
// printf("Sending JSON:\n%s\n", jsonString.String());
|
||||
|
||||
return _SendJsonRequest("pkg", jsonString, message);
|
||||
}
|
||||
|
||||
@@ -311,8 +309,6 @@ WebAppInterface::RetrieveBulkPackageInfo(const StringList& packageNames,
|
||||
.EndArray()
|
||||
.End();
|
||||
|
||||
// printf("Sending JSON:\n%s\n", jsonString.String());
|
||||
|
||||
return _SendJsonRequest("pkg", jsonString, message);
|
||||
}
|
||||
|
||||
@@ -366,12 +362,27 @@ WebAppInterface::RetrieveUserRatings(const BString& packageName,
|
||||
.EndArray()
|
||||
.End();
|
||||
|
||||
// printf("Sending JSON:\n%s\n", jsonString.String());
|
||||
|
||||
return _SendJsonRequest("userrating", jsonString, message);
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
WebAppInterface::RequestCaptcha(BMessage& message)
|
||||
{
|
||||
BString jsonString = JsonBuilder()
|
||||
.AddValue("jsonrpc", "2.0")
|
||||
.AddValue("id", ++fRequestIndex)
|
||||
.AddValue("method", "generateCaptcha")
|
||||
.AddArray("params")
|
||||
.AddObject()
|
||||
.EndObject()
|
||||
.EndArray()
|
||||
.End();
|
||||
|
||||
return _SendJsonRequest("captcha", jsonString, message);
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
WebAppInterface::RetrieveScreenshot(const BString& code,
|
||||
int32 width, int32 height, BDataIO* stream)
|
||||
|
||||
@@ -52,6 +52,9 @@ public:
|
||||
const BString& code,
|
||||
int32 width, int32 height,
|
||||
BDataIO* stream);
|
||||
|
||||
status_t RequestCaptcha(BMessage& message);
|
||||
|
||||
private:
|
||||
status_t _SendJsonRequest(const char* domain,
|
||||
BString jsonString, BMessage& reply) const;
|
||||
|
||||
Reference in New Issue
Block a user