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 a870c210..514ce463 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 | ||
@@ -127,7 +128,7 @@ void line_eval(char* line) | |||
127 | temp_id[i] = line[i+3]; | 128 | temp_id[i] = line[i+3]; |
128 | int num = m_addfriend(hex_string_to_bin(temp_id), (uint8_t*)"Install Gentoo", sizeof("Install Gentoo")); | 129 | int num = m_addfriend(hex_string_to_bin(temp_id), (uint8_t*)"Install Gentoo", sizeof("Install Gentoo")); |
129 | char numstring[100]; | 130 | char numstring[100]; |
130 | sprintf(numstring, "\n[i] added friend %d\n\n", num); | 131 | sprintf(numstring, "\n[i] Friend request sent. Wait to be accepted. Friend id: %d\n\n", num); |
131 | printf(numstring); | 132 | printf(numstring); |
132 | } | 133 | } |
133 | 134 | ||
@@ -144,7 +145,10 @@ void line_eval(char* line) | |||
144 | for (i=0; i < getnumfriends(); i++) { | 145 | for (i=0; i < getnumfriends(); i++) { |
145 | char name[MAX_NAME_LENGTH]; | 146 | char name[MAX_NAME_LENGTH]; |
146 | getname(i, (uint8_t*)name); | 147 | getname(i, (uint8_t*)name); |
147 | printf("[%d] %s\n\n", i, (uint8_t*)name); | 148 | if (m_friendstatus(i) == 0) |
149 | printf("[%d] No friend with this number\n\n", i); | ||
150 | else | ||
151 | printf("[%d] %s\n\n", i, (uint8_t*)name); | ||
148 | } | 152 | } |
149 | } | 153 | } |
150 | 154 | ||
@@ -159,6 +163,7 @@ void line_eval(char* line) | |||
159 | } | 163 | } |
160 | int num = atoi(numstring); | 164 | int num = atoi(numstring); |
161 | m_delfriend(num); | 165 | m_delfriend(num); |
166 | printf("\n\n"); | ||
162 | } | 167 | } |
163 | /* Send message to friend */ | 168 | /* Send message to friend */ |
164 | else if (line[1] == 'm') { | 169 | else if (line[1] == 'm') { |
diff --git a/testing/nTox_win32.h b/testing/nTox_win32.h index 7861be1c..dacabc74 100644 --- a/testing/nTox_win32.h +++ b/testing/nTox_win32.h | |||
@@ -28,4 +28,12 @@ | |||
28 | 28 | ||
29 | #define STRING_LENGTH 256 | 29 | #define STRING_LENGTH 256 |
30 | 30 | ||
31 | void do_header(); | ||
32 | void print_message(int friendnumber, uint8_t * string, uint16_t length); | ||
33 | void print_nickchange(int friendnumber, uint8_t *string, uint16_t length); | ||
34 | void print_statuschange(int friendnumber, uint8_t *string, uint16_t length); | ||
35 | void load_key(); | ||
36 | void line_eval(char* line); | ||
37 | void get_input(); | ||
38 | |||
31 | #endif \ No newline at end of file | 39 | #endif \ No newline at end of file |