mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-23 04:54:30 +00:00
setspammsg rpc
This commit is contained in:
parent
5e68d4e2ae
commit
2e1c79a4c8
@ -241,6 +241,7 @@ static const CRPCCommand vRPCCommands[] =
|
||||
{ "newdirectmsg", &newdirectmsg, false, true },
|
||||
{ "newrtmsg", &newrtmsg, false, true },
|
||||
{ "getposts", &getposts, false, true },
|
||||
{ "setspammsg", &setspammsg, false, true },
|
||||
};
|
||||
|
||||
CRPCTable::CRPCTable()
|
||||
|
@ -198,5 +198,6 @@ extern json_spirit::Value newpostmsg(const json_spirit::Array& params, bool fHel
|
||||
extern json_spirit::Value newdirectmsg(const json_spirit::Array& params, bool fHelp);
|
||||
extern json_spirit::Value newrtmsg(const json_spirit::Array& params, bool fHelp);
|
||||
extern json_spirit::Value getposts(const json_spirit::Array& params, bool fHelp);
|
||||
extern json_spirit::Value setspammsg(const json_spirit::Array& params, bool fHelp);
|
||||
|
||||
#endif
|
||||
|
@ -1138,3 +1138,18 @@ Value getposts(const Array& params, bool fHelp)
|
||||
return ret;
|
||||
}
|
||||
|
||||
Value setspammsg(const Array& params, bool fHelp)
|
||||
{
|
||||
if (fHelp || (params.size() != 2))
|
||||
throw runtime_error(
|
||||
"setspammsg <username> <msg>\n"
|
||||
"Set spam message attached to generated blocks");
|
||||
|
||||
string strUsername = params[0].get_str();
|
||||
string strMsg = params[1].get_str();
|
||||
|
||||
strSpamUser = strUsername;
|
||||
strSpamMessage = strMsg;
|
||||
|
||||
return Value();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user