about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorlogin <login@tilde.team>2023-07-23 10:53:30 +0000
committerlogin <login@tilde.team>2023-07-23 10:53:30 +0000
commit77683383eb76230566a43118407cbafc29861d54 (patch)
treeda33c1362f28959e5529fbb3d6e259b9d1eafe28
parentc1a67ff9b8df9b0249a73bc964a9be6a9a4a6e96 (diff)
downloadtcoin-77683383eb76230566a43118407cbafc29861d54.tar.gz
Adding preprocessor directives TCOIN_ERR_CONTACT_EMAIL and TCOIN_PASS_RESET_CONTACT_EMAIL to parameterise contact details
Parameterised contact details via TCOIN_ERR_CONTACT_EMAIL and TCOIN_PASS_RESET_CONTACT_EMAIL will allow them to be customised for tilde.green's tcoin
-rwxr-xr-xntcoin6
-rw-r--r--pcoin.cpp12
-rw-r--r--tcoin.cpp10
3 files changed, 17 insertions, 11 deletions
diff --git a/ntcoin b/ntcoin
index cdc1d2a..3a93243 100755
--- a/ntcoin
+++ b/ntcoin
@@ -29,6 +29,8 @@ then
 #define TCOIN_SCRYPT_PATH "'`/usr/bin/realpath -s $1`'/tcoin/bin/scrypt"
 #define PCOIN_BIN_PATH_W_SPACE "'`/usr/bin/realpath -s $2`'/pcoin "
 #define TCOIN_HOST_NAME "'$3'"
+#define TCOIN_ERR_CONTACT_EMAIL "login@tilde.town (town-only) or login@tilde.team (internet-wide)"
+#define TCOIN_PASS_RESET_CONTACT_EMAIL "`login@tilde.town` (tilde.town local email) or `login@tilde.team` (internet-wide email), or `/query login` on IRC"
 #define KROWBAR_OFF
 #define DA_OFF
 #define MINERCOIN_OFF'
@@ -183,6 +185,8 @@ else
 #define TCOIN_PATH_W_SLASH "'`/usr/bin/realpath -s $1`'/tcoin/"
 #define TCOIN_SCRYPT_PATH "'`/usr/bin/realpath -s $1`'/tcoin/bin/scrypt"
 #define TCOIN_HOST_NAME "'$4'"
+#define TCOIN_ERR_CONTACT_EMAIL "login@tilde.town (town-only) or login@tilde.team (internet-wide)"
+#define TCOIN_PASS_RESET_CONTACT_EMAIL "`login@tilde.town` (tilde.town local email) or `login@tilde.team` (internet-wide email), or `/query login` on IRC"
 #define KROWBAR_OFF
 #define DA_OFF
 #define MINERCOIN_OFF' > "`/usr/bin/realpath -s $1`/tcoin/bin/tcoin_defs.cpp"
@@ -210,6 +214,8 @@ else
 #define PCOIN_BIN_PATH "'`/usr/bin/realpath -s $2`'/pcoin"
 #define TCOIN_BIN_PATH_W_SPACE "'`/usr/bin/realpath -s $2`'/tcoin "
 #define PCOIN_BIN_PATH_W_SPACE "'`/usr/bin/realpath -s $2`'/pcoin "
+#define TCOIN_ERR_CONTACT_EMAIL "login@tilde.town (town-only) or login@tilde.team (internet-wide)"
+#define TCOIN_PASS_RESET_CONTACT_EMAIL "`login@tilde.town` (tilde.town local email) or `login@tilde.team` (internet-wide email), or `/query login` on IRC"
 #define KROWBAR_OFF
 #define DA_OFF
 #define MINERCOIN_OFF' > "`/usr/bin/realpath -s $1`/tcoin/bin/pcoin_defs.cpp"
diff --git a/pcoin.cpp b/pcoin.cpp
index fc41672..242dc21 100644
--- a/pcoin.cpp
+++ b/pcoin.cpp
@@ -358,7 +358,7 @@ int add_file_value(const char* file_name, const long long int &value_to_add, con
 
   if(!file2) //error
   {
-    std::cerr << "Fatal error " << ERR_ADD_FILE_VALUE_FATAL << ": the file \"" << file_name << "\" was unable to be updated. Please contact login@tilde.town (town-only) or login@tilde.team (internet-wide) to report this error (because it requires manual recovery).";
+    std::cerr << "Fatal error " << ERR_ADD_FILE_VALUE_FATAL << ": the file \"" << file_name << "\" was unable to be updated. Please contact " << TCOIN_ERR_CONTACT_EMAIL << " to report this error (because it requires manual recovery).";
     exit_program(ERR_ADD_FILE_VALUE_FATAL);
   }
   else
@@ -892,7 +892,7 @@ int send_message(const char* sender_username, const char* receiver_username, con
 
       if(!fout) //error
       {
-        std::cerr << "Fatal error " << ERR_SEND_MESSAGE_RECEIVER_MSG_FILE_UNABLE_TO_BE_UPDATED_FATAL << ": the receiver message file was unable to be updated. Please contact login@tilde.town (town-only) or login@tilde.team (internet-wide) to report this error (because it requires manual recovery).";
+        std::cerr << "Fatal error " << ERR_SEND_MESSAGE_RECEIVER_MSG_FILE_UNABLE_TO_BE_UPDATED_FATAL << ": the receiver message file was unable to be updated. Please contact " << TCOIN_ERR_CONTACT_EMAIL << " to report this error (because it requires manual recovery).";
         exit_program(ERR_SEND_MESSAGE_RECEIVER_MSG_FILE_UNABLE_TO_BE_UPDATED_FATAL);
       }
       else
@@ -983,7 +983,7 @@ int send_message(const char* sender_username, const char* receiver_username, con
 
             if(!fout) //error
             {
-              std::cerr << "Fatal error " << ERR_SEND_MESSAGE_PROGRAM_RECEIVER_MSG_FILE_UNABLE_TO_BE_UPDATED_FATAL << ": the receiver program_message file was unable to be updated. Please contact login@tilde.town (town-only) or login@tilde.team (internet-wide) to report this error (because it requires manual recovery).";
+              std::cerr << "Fatal error " << ERR_SEND_MESSAGE_PROGRAM_RECEIVER_MSG_FILE_UNABLE_TO_BE_UPDATED_FATAL << ": the receiver program_message file was unable to be updated. Please contact " TCOIN_ERR_CONTACT_EMAIL " to report this error (because it requires manual recovery).";
               exit_program(ERR_SEND_MESSAGE_PROGRAM_RECEIVER_MSG_FILE_UNABLE_TO_BE_UPDATED_FATAL);
             }
             else
@@ -1084,7 +1084,7 @@ int send_message(const char* sender_username, const char* receiver_username, con
 
           if(!fout) //error
           {
-            std::cerr << "Fatal error " << ERR_SEND_MESSAGE_SENDER_MSG_FILE_UNABLE_TO_BE_UPDATED_FATAL << ": the sender message file was unable to be updated. Please contact login@tilde.town (town-only) or login@tilde.team (internet-wide) to report this error (because it requires manual recovery).";
+            std::cerr << "Fatal error " << ERR_SEND_MESSAGE_SENDER_MSG_FILE_UNABLE_TO_BE_UPDATED_FATAL << ": the sender message file was unable to be updated. Please contact " << TCOIN_ERR_CONTACT_EMAIL << " to report this error (because it requires manual recovery).";
             exit_program(ERR_SEND_MESSAGE_SENDER_MSG_FILE_UNABLE_TO_BE_UPDATED_FATAL);
           }
           else
@@ -1172,7 +1172,7 @@ int send_message(const char* sender_username, const char* receiver_username, con
 
                 if(!fout) //error
                 {
-                  std::cerr << "Fatal error " << ERR_SEND_MESSAGE_SENDER_PROGRAM_MSG_FILE_UNABLE_TO_BE_UPDATED_FATAL << ": the sender program message file was unable to be updated. Please contact login@tilde.town (town-only) or login@tilde.team (internet-wide) to report this error (because it requires manual recovery).";
+                  std::cerr << "Fatal error " << ERR_SEND_MESSAGE_SENDER_PROGRAM_MSG_FILE_UNABLE_TO_BE_UPDATED_FATAL << ": the sender program message file was unable to be updated. Please contact " << TCOIN_ERR_CONTACT_EMAIL << " to report this error (because it requires manual recovery).";
                   exit_program(ERR_SEND_MESSAGE_SENDER_PROGRAM_MSG_FILE_UNABLE_TO_BE_UPDATED_FATAL);
                 }
                 else
@@ -1612,7 +1612,7 @@ void help()
   std::cout << "\n`" << PCOIN_BIN_PATH_W_SPACE << "name` or `" << PCOIN_BIN_PATH_W_SPACE << "-n`: print the name on the account";
   std::cout << "\nIn the commands with `<username> <amount>`, switching the two arguments around (i.e., from `<username> <amount>` to `<amount> <username>`) will also work";
   std::cout << "\n`" << PCOIN_BIN_PATH_W_SPACE << "--help`, `" << PCOIN_BIN_PATH_W_SPACE << "help` or `" << PCOIN_BIN_PATH_W_SPACE << "-h`: print this help text";
-  std::cout << "\nSend an email to `login@tilde.town` (tilde.town local email) or `login@tilde.team` (internet-wide email), or `/query login` on IRC to report any errors or request a key for your program.\n\n";
+  std::cout << "\nSend an email to " << TCOIN_PASS_RESET_CONTACT_EMAIL << " to report any errors or request a key for your program.\n\n";
 }
 
 bool is_number(const char* test_string)
diff --git a/tcoin.cpp b/tcoin.cpp
index 7bba50c..56a976c 100644
--- a/tcoin.cpp
+++ b/tcoin.cpp
@@ -345,7 +345,7 @@ int add_file_value(const char* file_name, const long long int &value_to_add, con
 
   if(!file2) //error
   {
-    std::cerr << "Fatal error " << ERR_ADD_FILE_VALUE_FATAL << ": the file \"" << file_name << "\" was unable to be updated. Please contact login@tilde.town (town-only) or login@tilde.team (internet-wide) to report this error (because it requires manual recovery).";
+    std::cerr << "Fatal error " << ERR_ADD_FILE_VALUE_FATAL << ": the file \"" << file_name << "\" was unable to be updated. Please contact " << TCOIN_ERR_CONTACT_EMAIL << " to report this error (because it requires manual recovery).";
     exit_program(ERR_ADD_FILE_VALUE_FATAL);
   }
   else
@@ -1083,7 +1083,7 @@ int send_message(const char* sender_username, const char* receiver_username, con
 
       if(!fout) //error
       {
-        std::cerr << "Fatal error" << ERR_SEND_MESSAGE_RECEIVER_MSG_FILE_UNABLE_TO_BE_UPDATED_FATAL << ": the receiver message file was unable to be updated. Please contact login@tilde.town (town-only) or login@tilde.team (internet-wide) to report this error (because it requires manual recovery).";
+        std::cerr << "Fatal error" << ERR_SEND_MESSAGE_RECEIVER_MSG_FILE_UNABLE_TO_BE_UPDATED_FATAL << ": the receiver message file was unable to be updated. Please contact " << TCOIN_ERR_CONTACT_EMAIL << " to report this error (because it requires manual recovery).";
         exit_program(ERR_SEND_MESSAGE_RECEIVER_MSG_FILE_UNABLE_TO_BE_UPDATED_FATAL);
       }
       else
@@ -1174,7 +1174,7 @@ int send_message(const char* sender_username, const char* receiver_username, con
 
             if(!fout) //error
             {
-              std::cerr << "Fatal error " << ERR_SEND_MESSAGE_PROGRAM_RECEIVER_MSG_FILE_UNABLE_TO_BE_UPDATED_FATAL << ": the receiver program_message file was unable to be updated. Please contact login@tilde.town (town-only) or login@tilde.team (internet-wide) to report this error (because it requires manual recovery).";
+              std::cerr << "Fatal error " << ERR_SEND_MESSAGE_PROGRAM_RECEIVER_MSG_FILE_UNABLE_TO_BE_UPDATED_FATAL << ": the receiver program_message file was unable to be updated. Please contact " << TCOIN_ERR_CONTACT_EMAIL << " to report this error (because it requires manual recovery).";
               exit_program(ERR_SEND_MESSAGE_PROGRAM_RECEIVER_MSG_FILE_UNABLE_TO_BE_UPDATED_FATAL);
             }
             else
@@ -1274,7 +1274,7 @@ int send_message(const char* sender_username, const char* receiver_username, con
 
           if(!fout) //error
           {
-            std::cerr << "Fatal error " << ERR_SEND_MESSAGE_SENDER_MSG_FILE_UNABLE_TO_BE_UPDATED_FATAL << ": the sender message file was unable to be updated. Please contact login@tilde.town (town-only) or login@tilde.team (internet-wide) to report this error (because it requires manual recovery).";
+            std::cerr << "Fatal error " << ERR_SEND_MESSAGE_SENDER_MSG_FILE_UNABLE_TO_BE_UPDATED_FATAL << ": the sender message file was unable to be updated. Please contact " << TCOIN_ERR_CONTACT_EMAIL << " to report this error (because it requires manual recovery).";
             exit_program(ERR_SEND_MESSAGE_SENDER_MSG_FILE_UNABLE_TO_BE_UPDATED_FATAL);
           }
           else
@@ -1597,7 +1597,7 @@ void help(long long int &base_amount)
   std::cout << "\n`tcoin silentsend <username> <amount> [\"<message>\"]`, `tcoin send -s <username> <amount> [\"<message>\"]` or `tcoin -ss <username> <amount> [\"<message>\"]`: send <amount> tildecoins to <username> with an optional (as indicated by [ and ], which should not be included in the actual comment) message included without printing anything";
   std::cout << "\nIn the commands with `<username> <amount>`, switching the two arguments around (i.e., from `<username> <amount>` to `<amount> <username>`) will also work";
   std::cout << "\n`tcoin --help`, `tcoin help` or `tcoin -h`: print this help text";
-  std::cout << "\nSend an email to `login@tilde.town` (tilde.town local email) or `login@tilde.team` (internet-wide email), or `/query login` on IRC to request a passphrase reset.\n\n";
+  std::cout << "\nSend an email to " << TCOIN_PASS_RESET_CONTACT_EMAIL << " to request a passphrase reset.\n\n";
 }
 
 bool is_number(const char* test_string)