summaryrefslogtreecommitdiff
path: root/testing/nTox.c
diff options
context:
space:
mode:
Diffstat (limited to 'testing/nTox.c')
-rw-r--r--testing/nTox.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/testing/nTox.c b/testing/nTox.c
index 5c560079..6aef1d7b 100644
--- a/testing/nTox.c
+++ b/testing/nTox.c
@@ -35,6 +35,8 @@
35 35
36char lines[HISTORY][STRING_LENGTH]; 36char lines[HISTORY][STRING_LENGTH];
37char line[STRING_LENGTH]; 37char line[STRING_LENGTH];
38char *help = "[i] commands: /f ID (to add friend), /m friendnumber message (to send message), /s status (to change status)\n"
39 "[i] /l list (list friends), /h for help, /i for info, /n nick (to change nickname), /q (to quit)";
38int x,y; 40int x,y;
39 41
40uint8_t pending_requests[256][CLIENT_ID_SIZE]; 42uint8_t pending_requests[256][CLIENT_ID_SIZE];
@@ -72,13 +74,13 @@ void print_friendlist()
72 74
73char *format_message(char *message, int friendnum) 75char *format_message(char *message, int friendnum)
74{ 76{
75 char name[MAX_NAME_LENGTH]; 77 char name[MAX_NAME_LENGTH];
76 if(friendnum != -1) { 78 if(friendnum != -1) {
77 getname(friendnum, (uint8_t*)name); 79 getname(friendnum, (uint8_t*)name);
78 } else { 80 } else {
79 getself_name((uint8_t*)name); 81 getself_name((uint8_t*)name);
80 } 82 }
81 char *msg = malloc(100+strlen(message)+strlen(name)+1); 83 char *msg = malloc(100+strlen(message)+strlen(name)+1);
82 time_t rawtime; 84 time_t rawtime;
83 struct tm * timeinfo; 85 struct tm * timeinfo;
84 time ( &rawtime ); 86 time ( &rawtime );
@@ -129,7 +131,7 @@ void line_eval(char lines[HISTORY][STRING_LENGTH], char *line)
129 if(m_sendmessage(num, (uint8_t*) message, sizeof(message)) != 1) { 131 if(m_sendmessage(num, (uint8_t*) message, sizeof(message)) != 1) {
130 new_lines("[i] could not send message"); 132 new_lines("[i] could not send message");
131 } else { 133 } else {
132 new_lines(format_message(message, -1)); 134 new_lines(format_message(message, -1));
133 } 135 }
134 } 136 }
135 else if (line[1] == 'n') { 137 else if (line[1] == 'n') {
@@ -176,8 +178,7 @@ void line_eval(char lines[HISTORY][STRING_LENGTH], char *line)
176 } 178 }
177 179
178 else if (line[1] == 'h') { //help 180 else if (line[1] == 'h') { //help
179 new_lines("[i] commands: /f ID (to add friend), /m friendnumber message (to send message), /s status (to change status)"); 181 new_lines(help);
180 new_lines("[i] /l list (list friends), /h for help, /i for info, /n nick (to change nickname), /q (to quit)");
181 } 182 }
182 183
183 else if (line[1] == 'i') { //info 184 else if (line[1] == 'i') { //info
@@ -389,8 +390,7 @@ int main(int argc, char *argv[])
389 raw(); 390 raw();
390 getmaxyx(stdscr,y,x); 391 getmaxyx(stdscr,y,x);
391 new_lines(idstring0); 392 new_lines(idstring0);
392 new_lines("[i] commands: /f ID (to add friend), /m friendnumber message (to send message), /s status (to change status)"); 393 new_lines(help);
393 new_lines("[i] /l list (list friends), /h for help, /i for info, /n nick (to change nickname), /q (to quit)");
394 strcpy(line, ""); 394 strcpy(line, "");
395 IP_Port bootstrap_ip_port; 395 IP_Port bootstrap_ip_port;
396 bootstrap_ip_port.port = htons(atoi(argv[2])); 396 bootstrap_ip_port.port = htons(atoi(argv[2]));