mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-22 17:03:03 +01:00
fixed friend add bugs
This commit is contained in:
parent
2f302b36e0
commit
2e0fa701cc
18
prompt.c
18
prompt.c
@ -133,10 +133,26 @@ static void execute(ToxWindow* self, char* cmd) {
|
||||
}
|
||||
|
||||
num = m_addfriend(id_bin, (uint8_t*) msg, strlen(msg)+1);
|
||||
|
||||
switch (num) {
|
||||
case -1:
|
||||
wprintw(self->window, "Message is too long.\n");
|
||||
break;
|
||||
case -2:
|
||||
wprintw(self->window, "That appears to be your own ID.\n");
|
||||
break;
|
||||
case -3:
|
||||
wprintw(self->window, "Friend request already sent.\n");
|
||||
break;
|
||||
case -4:
|
||||
wprintw(self->window, "Invalid ID.\n");
|
||||
break;
|
||||
default:
|
||||
wprintw(self->window, "Friend added as %d.\n", num);
|
||||
on_friendadded(num);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
else if(!strcmp(cmd, "help")) {
|
||||
wattron(self->window, COLOR_PAIR(2) | A_BOLD);
|
||||
wprintw(self->window, "Commands:\n");
|
||||
|
Loading…
Reference in New Issue
Block a user