1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-04 23:46:44 +02:00

Merge upstream

This commit is contained in:
mannol
2014-03-23 22:54:56 +01:00
parent 705a55d1b5
commit 58f33fa1d6
5 changed files with 33 additions and 4 deletions

View File

@ -498,7 +498,7 @@ void cmd_call(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA
return;
on_error:
wprintw(window, "%s %d\n", error_str, argc);
wprintw(window, "%s\n", error_str);
}
void cmd_answer(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE])
@ -526,6 +526,31 @@ on_error:
wprintw(window, "%s\n", error_str);
}
void cmd_reject(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE])
{
const char* error_str;
if (argc != 0) { error_str = "Invalid syntax!"; goto on_error; }
if ( !ASettins.av ) { error_str = "Audio not supported!"; goto on_error; }
ToxAvError error = toxav_reject(ASettins.av, "Why not?");
if ( error != ErrorNone ) {
if ( error == ErrorInvalidState ) error_str = "Cannot reject in invalid state!";
else if ( error == ErrorNoCall ) error_str = "No incomming call!";
else error_str = "Internal error!";
goto on_error;
}
/* Callback will print status... */
return;
on_error:
wprintw(window, "%s\n", error_str);
}
void cmd_hangup(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE])
{
const char* error_str;
@ -557,7 +582,7 @@ void cmd_cancel(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[
if ( !ASettins.av ) { error_str = "Audio not supported!"; goto on_error; }
ToxAvError error = toxav_hangup(ASettins.av);
ToxAvError error = toxav_cancel(ASettins.av, self->num, "Only those who appreciate small things know the beauty of life");
if ( error != ErrorNone ) {
if ( error == ErrorNoCall ) error_str = "No call!";