diff options
author | login (tilde.temm) <login@tilde.team> | 2020-02-21 23:24:10 -0500 |
---|---|---|
committer | login (tilde.temm) <login@tilde.team> | 2020-02-21 23:24:10 -0500 |
commit | 4f1c68ddeda50c5ed971650e4fc9981d019a2c72 (patch) | |
tree | edd4a5c50fe8a77dfa02b7e5a4208b8563be2250 | |
parent | 578b4277ec91a19c266f52090182ad2ce74dea23 (diff) | |
download | tcoin-4f1c68ddeda50c5ed971650e4fc9981d019a2c72.tar.gz |
Added silentsend with message case to pcoin.cpp
I don't know how I missed this, because I remember coming across this deficiency before. I had missed a case, where silentsend is requested but with a message. Previously, it would fail without any message to stdout or stderr (only a return code). Now, silentsend with a message works even on pcoin.cpp (tcoin.cpp already had this change).
-rw-r--r-- | pcoin.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/pcoin.cpp b/pcoin.cpp index e9f563b..61a7945 100644 --- a/pcoin.cpp +++ b/pcoin.cpp @@ -1934,6 +1934,21 @@ int main(int argc, char *argv[]) else send_message(get_username().c_str(), argv[3], "", strtol100(argv[2]), "silent"); } + if(argc==5) //custom message included + { + int return_value; + if(is_number(argv[2])) + return_value = send(get_username().c_str(), argv[3], strtol100(argv[2]), base_amount, "silent"); + else + return_value = send(get_username().c_str(), argv[2], strtol100(argv[3]), base_amount, "silent"); + if(!return_value) //send was successful + { + if(is_number(argv[2])) + send_message(get_username().c_str(), argv[3], argv[4], strtol100(argv[2]), "silent"); + else + send_message(get_username().c_str(), argv[2], argv[4], strtol100(argv[3]), "silent"); + } + } else return ERR_SILENTSEND; } |