summaryrefslogtreecommitdiff
path: root/testing/toxic/prompt.c
diff options
context:
space:
mode:
Diffstat (limited to 'testing/toxic/prompt.c')
-rw-r--r--testing/toxic/prompt.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/testing/toxic/prompt.c b/testing/toxic/prompt.c
index a47238af..365aee49 100644
--- a/testing/toxic/prompt.c
+++ b/testing/toxic/prompt.c
@@ -148,7 +148,7 @@ static void execute(ToxWindow* self, char* cmd) {
148 wprintw(self->window, "Friend request already sent.\n"); 148 wprintw(self->window, "Friend request already sent.\n");
149 break; 149 break;
150 case -5: 150 case -5:
151 wprintw(self->window, "[i] Undefined error when adding friend.\n"); 151 wprintw(self->window, "Undefined error when adding friend.\n");
152 break; 152 break;
153 default: 153 default:
154 wprintw(self->window, "Friend added as %d.\n", num); 154 wprintw(self->window, "Friend added as %d.\n", num);
@@ -178,12 +178,13 @@ static void execute(ToxWindow* self, char* cmd) {
178 178
179 nick = strchr(cmd, ' '); 179 nick = strchr(cmd, ' ');
180 if(nick == NULL) { 180 if(nick == NULL) {
181 wprintw(self->window, "Invalid syntax.\n");
181 return; 182 return;
182 } 183 }
183 nick++; 184 nick++;
184 185
185 setname((uint8_t*) nick, strlen(nick)+1); 186 setname((uint8_t*) nick, strlen(nick)+1);
186 wprintw(self->window, "Nickname set to: %s.\n", nick); 187 wprintw(self->window, "Nickname set to: %s\n", nick);
187 } 188 }
188 else if(!strcmp(cmd, "myid")) { 189 else if(!strcmp(cmd, "myid")) {
189 char id[32*2 + 1] = {0}; 190 char id[32*2 + 1] = {0};
@@ -195,7 +196,7 @@ static void execute(ToxWindow* self, char* cmd) {
195 strcat(id, xx); 196 strcat(id, xx);
196 } 197 }
197 198
198 wprintw(self->window, "%s\n", id); 199 wprintw(self->window, "Your ID: %s\n", id);
199 } 200 }
200 else if(!strncmp(cmd, "accept ", strlen("accept "))) { 201 else if(!strncmp(cmd, "accept ", strlen("accept "))) {
201 char* id; 202 char* id;
@@ -256,7 +257,7 @@ static void execute(ToxWindow* self, char* cmd) {
256 wclear(self->window); 257 wclear(self->window);
257 } 258 }
258 else { 259 else {
259 wprintw(self->window, "Invalid syntax.\n"); 260 wprintw(self->window, "Invalid command.\n");
260 } 261 }
261} 262}
262 263