Browse Source

getlasthave

miguelfreitas
Miguel Freitas 11 years ago
parent
commit
7182f1bad8
  1. 1
      src/bitcoinrpc.cpp
  2. 1
      src/bitcoinrpc.h
  3. 15
      src/twister.cpp

1
src/bitcoinrpc.cpp

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

1
src/bitcoinrpc.h

@ -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 follow(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value unfollow(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 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 listusernamespartial(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getdefaultuser(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); extern json_spirit::Value setdefaultuser(const json_spirit::Array& params, bool fHelp);

15
src/twister.cpp

@ -1164,6 +1164,21 @@ Value getfollowing(const Array& params, bool fHelp)
return ret; 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) Value listusernamespartial(const Array& params, bool fHelp)
{ {
if (fHelp || (params.size() != 2)) if (fHelp || (params.size() != 2))

Loading…
Cancel
Save