mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-22 22:03:02 +01:00
Merge pull request #229 from JFreegman/master
fixed friend add bugs and gave no message its own error
This commit is contained in:
commit
6405632b49
20
prompt.c
20
prompt.c
@ -134,10 +134,28 @@ static void execute(ToxWindow* self, char* cmd) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
num = m_addfriend(id_bin, (uint8_t*) msg, strlen(msg)+1);
|
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, "Please add a message to your request.\n");
|
||||||
|
case -3:
|
||||||
|
wprintw(self->window, "That appears to be your own ID.\n");
|
||||||
|
break;
|
||||||
|
case -4:
|
||||||
|
wprintw(self->window, "Friend request already sent.\n");
|
||||||
|
break;
|
||||||
|
case -5:
|
||||||
|
wprintw(self->window, "[i] Undefined error when adding friend.\n");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
wprintw(self->window, "Friend added as %d.\n", num);
|
wprintw(self->window, "Friend added as %d.\n", num);
|
||||||
on_friendadded(num);
|
on_friendadded(num);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
else if(!strcmp(cmd, "help")) {
|
else if(!strcmp(cmd, "help")) {
|
||||||
print_usage(self);
|
print_usage(self);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user