mirror of
https://github.com/Tha14/toxic.git
synced 2025-12-07 14:06:36 +01:00
alert chat window on file send/failure
This commit is contained in:
16
src/main.c
16
src/main.c
@@ -379,7 +379,13 @@ static void do_file_senders(Tox *m)
|
||||
|
||||
/* If file transfer has timed out kill transfer and send kill control */
|
||||
if (timed_out(file_senders[i].timestamp, current_time, TIMEOUT_FILESENDER)) {
|
||||
wprintw(file_senders[i].chatwin, "File transfer for '%s' timed out.\n", pathname);
|
||||
ChatContext *ctx = (ChatContext *) file_senders[i].toxwin->chatwin;
|
||||
|
||||
if (ctx != NULL) {
|
||||
wprintw(ctx->history, "File transfer for '%s' timed out.\n", pathname);
|
||||
alert_window(file_senders[i].toxwin);
|
||||
}
|
||||
|
||||
tox_file_sendcontrol(m, friendnum, 0, filenum, TOX_FILECONTROL_KILL, 0, 0);
|
||||
close_file_sender(i);
|
||||
continue;
|
||||
@@ -397,7 +403,13 @@ static void do_file_senders(Tox *m)
|
||||
tox_filedata_size(m, friendnum), fp);
|
||||
|
||||
if (file_senders[i].piecelen == 0) {
|
||||
wprintw(file_senders[i].chatwin, "File '%s' successfuly sent.\n", pathname);
|
||||
ChatContext *ctx = (ChatContext *) file_senders[i].toxwin->chatwin;
|
||||
|
||||
if (ctx != NULL) {
|
||||
wprintw(ctx->history, "File '%s' successfuly sent.\n", pathname);
|
||||
alert_window(file_senders[i].toxwin);
|
||||
}
|
||||
|
||||
tox_file_sendcontrol(m, friendnum, 0, filenum, TOX_FILECONTROL_FINISHED, 0, 0);
|
||||
close_file_sender(i);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user