diff options
Diffstat (limited to 'testing/nTox.c')
-rw-r--r-- | testing/nTox.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/testing/nTox.c b/testing/nTox.c index 54f973d0..29726a3a 100644 --- a/testing/nTox.c +++ b/testing/nTox.c | |||
@@ -35,8 +35,12 @@ | |||
35 | 35 | ||
36 | char lines[HISTORY][STRING_LENGTH]; | 36 | char lines[HISTORY][STRING_LENGTH]; |
37 | char line[STRING_LENGTH]; | 37 | char line[STRING_LENGTH]; |
38 | |||
39 | char *help = "[i] commands: /f ID (to add friend), /m friendnumber message (to send message), /s status (to change status)\n" | ||
40 | "[i] /l list (list friends), /h for help, /i for info, /n nick (to change nickname), /q (to quit)"; | ||
38 | int x, y; | 41 | int x, y; |
39 | 42 | ||
43 | |||
40 | uint8_t pending_requests[256][CLIENT_ID_SIZE]; | 44 | uint8_t pending_requests[256][CLIENT_ID_SIZE]; |
41 | uint8_t num_requests = 0; | 45 | uint8_t num_requests = 0; |
42 | 46 | ||
@@ -72,13 +76,14 @@ void print_friendlist() | |||
72 | 76 | ||
73 | char *format_message(char *message, int friendnum) | 77 | char *format_message(char *message, int friendnum) |
74 | { | 78 | { |
75 | char name[MAX_NAME_LENGTH]; | 79 | char name[MAX_NAME_LENGTH]; |
76 | if (friendnum != -1) { | 80 | if (friendnum != -1) { |
77 | getname(friendnum, (uint8_t*)name); | 81 | getname(friendnum, (uint8_t*)name); |
78 | } else { | 82 | } else { |
79 | getself_name((uint8_t*)name); | 83 | getself_name((uint8_t*)name); |
80 | } | 84 | } |
81 | char *msg = malloc(100+strlen(message)+strlen(name)+1); | 85 | char *msg = malloc(100+strlen(message)+strlen(name)+1); |
86 | |||
82 | time_t rawtime; | 87 | time_t rawtime; |
83 | struct tm * timeinfo; | 88 | struct tm * timeinfo; |
84 | time ( &rawtime ); | 89 | time ( &rawtime ); |
@@ -130,7 +135,7 @@ void line_eval(char lines[HISTORY][STRING_LENGTH], char *line) | |||
130 | if (m_sendmessage(num, (uint8_t*) message, sizeof(message)) != 1) { | 135 | if (m_sendmessage(num, (uint8_t*) message, sizeof(message)) != 1) { |
131 | new_lines("[i] could not send message"); | 136 | new_lines("[i] could not send message"); |
132 | } else { | 137 | } else { |
133 | new_lines(format_message(message, -1)); | 138 | new_lines(format_message(message, -1)); |
134 | } | 139 | } |
135 | } | 140 | } |
136 | else if (inpt_command == 'n') { | 141 | else if (inpt_command == 'n') { |
@@ -394,8 +399,7 @@ int main(int argc, char *argv[]) | |||
394 | raw(); | 399 | raw(); |
395 | getmaxyx(stdscr, y, x); | 400 | getmaxyx(stdscr, y, x); |
396 | new_lines(idstring0); | 401 | new_lines(idstring0); |
397 | new_lines("[i] commands: /f ID (to add friend), /m friendnumber message (to send message), /s status (to change status)"); | 402 | new_lines(help); |
398 | new_lines("[i] /l list (list friends), /h for help, /i for info, /n nick (to change nickname), /q (to quit)"); | ||
399 | strcpy(line, ""); | 403 | strcpy(line, ""); |
400 | IP_Port bootstrap_ip_port; | 404 | IP_Port bootstrap_ip_port; |
401 | bootstrap_ip_port.port = htons(atoi(argv[2])); | 405 | bootstrap_ip_port.port = htons(atoi(argv[2])); |