1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-05 18:06:46 +02:00

added command functionality to chat windows and a few minor improvements

This commit is contained in:
Jfreegman
2013-08-04 04:42:17 -04:00
parent 67e76d397d
commit 6ea6af557b
2 changed files with 77 additions and 17 deletions

View File

@ -148,7 +148,7 @@ static void execute(ToxWindow* self, char* cmd) {
wprintw(self->window, "Friend request already sent.\n");
break;
case -5:
wprintw(self->window, "[i] Undefined error when adding friend.\n");
wprintw(self->window, "Undefined error when adding friend.\n");
break;
default:
wprintw(self->window, "Friend added as %d.\n", num);
@ -178,12 +178,13 @@ static void execute(ToxWindow* self, char* cmd) {
nick = strchr(cmd, ' ');
if(nick == NULL) {
wprintw(self->window, "Invalid syntax.\n");
return;
}
nick++;
setname((uint8_t*) nick, strlen(nick)+1);
wprintw(self->window, "Nickname set to: %s.\n", nick);
wprintw(self->window, "Nickname set to: %s\n", nick);
}
else if(!strcmp(cmd, "myid")) {
char id[32*2 + 1] = {0};
@ -195,7 +196,7 @@ static void execute(ToxWindow* self, char* cmd) {
strcat(id, xx);
}
wprintw(self->window, "%s\n", id);
wprintw(self->window, "Your ID: %s\n", id);
}
else if(!strncmp(cmd, "accept ", strlen("accept "))) {
char* id;
@ -256,7 +257,7 @@ static void execute(ToxWindow* self, char* cmd) {
wclear(self->window);
}
else {
wprintw(self->window, "Invalid syntax.\n");
wprintw(self->window, "Invalid command.\n");
}
}