diff options
Diffstat (limited to 'testing')
-rw-r--r-- | testing/cmake/nTox_win32.cmake | 2 | ||||
-rw-r--r-- | testing/nTox_win32.c | 13 | ||||
-rw-r--r-- | testing/nTox_win32.h | 8 |
3 files changed, 18 insertions, 5 deletions
diff --git a/testing/cmake/nTox_win32.cmake b/testing/cmake/nTox_win32.cmake index 5acfb411..0e33913f 100644 --- a/testing/cmake/nTox_win32.cmake +++ b/testing/cmake/nTox_win32.cmake | |||
@@ -5,5 +5,5 @@ set(exe_name nTox_win32) | |||
5 | 5 | ||
6 | add_executable(${exe_name} | 6 | add_executable(${exe_name} |
7 | nTox_win32.c misc_tools.c) | 7 | nTox_win32.c misc_tools.c) |
8 | 8 | ||
9 | linkCoreLibraries(${exe_name}) | 9 | linkCoreLibraries(${exe_name}) |
diff --git a/testing/nTox_win32.c b/testing/nTox_win32.c index b7b6a70d..ad114f46 100644 --- a/testing/nTox_win32.c +++ b/testing/nTox_win32.c | |||
@@ -77,11 +77,12 @@ void print_nickchange(int friendnumber, uint8_t *string, uint16_t length) | |||
77 | printf(msg); | 77 | printf(msg); |
78 | } | 78 | } |
79 | 79 | ||
80 | void print_statuschange(int friendnumber, uint8_t *string, uint16_t length) { | 80 | void print_statuschange(int friendnumber, uint8_t *string, uint16_t length) |
81 | { | ||
81 | char name[MAX_NAME_LENGTH]; | 82 | char name[MAX_NAME_LENGTH]; |
82 | getname(friendnumber, (uint8_t*)name); | 83 | getname(friendnumber, (uint8_t*)name); |
83 | char msg[100+length+strlen(name)+1]; | 84 | char msg[100+length+strlen(name)+1]; |
84 | sprintf(msg, "\n\n[i] [%d] %s's status changed to %s.\n", friendnumber, name, string); | 85 | sprintf(msg, "\n\n[i] [%d] %s's status changed to %s.\n\n", friendnumber, name, string); |
85 | printf(msg); | 86 | printf(msg); |
86 | } | 87 | } |
87 | 88 | ||
@@ -126,7 +127,7 @@ void line_eval(char* line) | |||
126 | temp_id[i] = line[i+3]; | 127 | temp_id[i] = line[i+3]; |
127 | int num = m_addfriend(hex_string_to_bin(temp_id), (uint8_t*)"Install Gentoo", sizeof("Install Gentoo")); | 128 | int num = m_addfriend(hex_string_to_bin(temp_id), (uint8_t*)"Install Gentoo", sizeof("Install Gentoo")); |
128 | char numstring[100]; | 129 | char numstring[100]; |
129 | sprintf(numstring, "\n[i] added friend %d\n\n", num); | 130 | sprintf(numstring, "\n[i] Friend request sent. Wait to be accepted. Friend id: %d\n\n", num); |
130 | printf(numstring); | 131 | printf(numstring); |
131 | } | 132 | } |
132 | 133 | ||
@@ -142,7 +143,10 @@ void line_eval(char* line) | |||
142 | for (i = 0; i < getnumfriends(); i++) { | 143 | for (i = 0; i < getnumfriends(); i++) { |
143 | char name[MAX_NAME_LENGTH]; | 144 | char name[MAX_NAME_LENGTH]; |
144 | getname(i, (uint8_t*)name); | 145 | getname(i, (uint8_t*)name); |
145 | printf("[%d] %s\n\n", i, (uint8_t*)name); | 146 | if (m_friendstatus(i) == 0) |
147 | printf("[%d] No friend with this number\n\n", i); | ||
148 | else | ||
149 | printf("[%d] %s\n\n", i, (uint8_t*)name); | ||
146 | } | 150 | } |
147 | } | 151 | } |
148 | 152 | ||
@@ -157,6 +161,7 @@ void line_eval(char* line) | |||
157 | } | 161 | } |
158 | int num = atoi(numstring); | 162 | int num = atoi(numstring); |
159 | m_delfriend(num); | 163 | m_delfriend(num); |
164 | printf("\n\n"); | ||
160 | } | 165 | } |
161 | /* Send message to friend */ | 166 | /* Send message to friend */ |
162 | else if (inpt_command == 'm') { | 167 | else if (inpt_command == 'm') { |
diff --git a/testing/nTox_win32.h b/testing/nTox_win32.h index 84d4a778..374348a4 100644 --- a/testing/nTox_win32.h +++ b/testing/nTox_win32.h | |||
@@ -29,4 +29,12 @@ | |||
29 | #define STRING_LENGTH 256 | 29 | #define STRING_LENGTH 256 |
30 | #define PUB_KEY_BYTES 32 | 30 | #define PUB_KEY_BYTES 32 |
31 | 31 | ||
32 | void do_header(); | ||
33 | void print_message(int friendnumber, uint8_t * string, uint16_t length); | ||
34 | void print_nickchange(int friendnumber, uint8_t *string, uint16_t length); | ||
35 | void print_statuschange(int friendnumber, uint8_t *string, uint16_t length); | ||
36 | void load_key(); | ||
37 | void line_eval(char* line); | ||
38 | void get_input(); | ||
39 | |||
32 | #endif \ No newline at end of file | 40 | #endif \ No newline at end of file |