mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-26 16:03:27 +01:00
don't allow calls to offline friends
This commit is contained in:
parent
f324d2d34b
commit
490c80dae9
@ -386,6 +386,11 @@ void cmd_call(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA
|
|||||||
goto on_error;
|
goto on_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!self->stb->is_online) {
|
||||||
|
error_str = "Friend is offline.";
|
||||||
|
goto on_error;
|
||||||
|
}
|
||||||
|
|
||||||
ToxAvError error = toxav_call(ASettins.av, &self->call_idx, self->num, TypeAudio, 30);
|
ToxAvError error = toxav_call(ASettins.av, &self->call_idx, self->num, TypeAudio, 30);
|
||||||
|
|
||||||
if ( error != ErrorNone ) {
|
if ( error != ErrorNone ) {
|
||||||
|
@ -497,6 +497,7 @@ void chat_onCancel (ToxWindow *self, ToxAv *av, int call_index)
|
|||||||
if ( self->call_idx != call_index || self->num != toxav_get_peer_id(av, call_index, 0))
|
if ( self->call_idx != call_index || self->num != toxav_get_peer_id(av, call_index, 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
kill_infobox(self);
|
||||||
self->call_idx = -1;
|
self->call_idx = -1;
|
||||||
line_info_add(self, NULL, NULL, NULL, "Call canceled!", SYS_MSG, 0, 0);
|
line_info_add(self, NULL, NULL, NULL, "Call canceled!", SYS_MSG, 0, 0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user