Skip to content

Commit

Permalink
HaikuDepot: Get existing rating from a user for a package
Browse files Browse the repository at this point in the history
  • Loading branch information
stippi committed Sep 28, 2014
1 parent 0359811 commit 054139a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/apps/haikudepot/model/WebAppInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,30 @@ WebAppInterface::RetrieveUserRatings(const BString& packageName,
}


status_t
WebAppInterface::RetrieveUserRating(const BString& packageName,
const BString& architecture, const BString& username,
BMessage& message)
{
BString jsonString = JsonBuilder()
.AddValue("jsonrpc", "2.0")
.AddValue("id", ++fRequestIndex)
.AddValue("method", "searchUserRatings")
.AddArray("params")
.AddObject()
.AddValue("userNickname", username)
.AddValue("pkgName", packageName)
.AddValue("pkgVersionArchitectureCode", architecture)
.AddValue("offset", 0)
.AddValue("limit", 1)
.EndObject()
.EndArray()
.End();

return _SendJsonRequest("userrating", jsonString, false, message);
}


status_t
WebAppInterface::RetrieveScreenshot(const BString& code,
int32 width, int32 height, BDataIO* stream)
Expand Down
6 changes: 6 additions & 0 deletions src/apps/haikudepot/model/WebAppInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ class WebAppInterface {
int resultOffset, int maxResults,
BMessage& message);

status_t RetrieveUserRating(
const BString& packageName,
const BString& architecture,
const BString& username,
BMessage& message);

status_t RetrieveScreenshot(
const BString& code,
int32 width, int32 height,
Expand Down

0 comments on commit 054139a

Please sign in to comment.