mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Added: Handling requests to set opinion about identity
This commit is contained in:
parent
3f54568d7f
commit
120ca9d078
@ -146,6 +146,8 @@ IdentityHandler::IdentityHandler(StateTokenServer *sts, RsNotify *notify, RsIden
|
||||
addResourceHandler("delete_identity", this, &IdentityHandler::handleDeleteIdentity);
|
||||
|
||||
addResourceHandler("get_identity_details", this, &IdentityHandler::handleGetIdentityDetails);
|
||||
|
||||
addResourceHandler("set_ban_node", this, &IdentityHandler::handleSetBanNode);
|
||||
}
|
||||
|
||||
IdentityHandler::~IdentityHandler()
|
||||
@ -472,6 +474,19 @@ void IdentityHandler::handleGetIdentityDetails(Request& req, Response& resp)
|
||||
resp.setOk();
|
||||
}
|
||||
|
||||
void IdentityHandler::handleSetBanNode(Request& req, Response& resp)
|
||||
{
|
||||
std::string pgp_id;
|
||||
req.mStream << makeKeyValueReference("pgp_id", pgp_id);
|
||||
RsPgpId pgpId(pgp_id);
|
||||
|
||||
bool banned_node;
|
||||
req.mStream << makeKeyValueReference("banned_node", banned_node);
|
||||
rsReputations->banNode(pgpId, banned_node);
|
||||
|
||||
resp.setOk();
|
||||
}
|
||||
|
||||
ResponseTask* IdentityHandler::handleOwn(Request & /* req */, Response &resp)
|
||||
{
|
||||
StateToken state;
|
||||
|
@ -31,6 +31,8 @@ private:
|
||||
|
||||
void handleGetIdentityDetails(Request& req, Response& resp);
|
||||
|
||||
void handleSetBanNode(Request& req, Response& resp);
|
||||
|
||||
ResponseTask *handleOwn(Request& req, Response& resp);
|
||||
ResponseTask *handleCreateIdentity(Request& req, Response& resp);
|
||||
ResponseTask *handleDeleteIdentity(Request& req, Response& resp);
|
||||
|
Loading…
Reference in New Issue
Block a user