getlasthave

This commit is contained in:
Miguel Freitas 2013-10-06 22:29:17 -03:00
parent 7a72e63372
commit 7182f1bad8
3 changed files with 17 additions and 0 deletions

View File

@ -251,6 +251,7 @@ static const CRPCCommand vRPCCommands[] =
{ "follow", &follow, false, true },
{ "unfollow", &unfollow, false, true },
{ "getfollowing", &getfollowing, false, true },
{ "getlasthave", &getlasthave, false, true },
{ "listusernamespartial", &listusernamespartial, false, true },
{ "getdefaultuser", &getdefaultuser, false, true },
{ "setdefaultuser", &setdefaultuser, false, true },

View File

@ -203,6 +203,7 @@ extern json_spirit::Value getspammsg(const json_spirit::Array& params, bool fHel
extern json_spirit::Value follow(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value unfollow(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getfollowing(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getlasthave(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value listusernamespartial(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getdefaultuser(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value setdefaultuser(const json_spirit::Array& params, bool fHelp);

View File

@ -1164,6 +1164,21 @@ Value getfollowing(const Array& params, bool fHelp)
return ret;
}
Value getlasthave(const Array& params, bool fHelp)
{
if (fHelp || (params.size() != 0))
throw runtime_error(
"getfollowing\n"
"get last 'have' (higher post number) of each user user we follow");
Object ret;
BOOST_FOREACH(string username, m_following) {
ret.push_back(Pair(username,lastPostKfromTorrent(username)));
}
return ret;
}
Value listusernamespartial(const Array& params, bool fHelp)
{
if (fHelp || (params.size() != 2))