1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-23 02:23:02 +01:00

Send file control cancel on failure to resume transfer

This commit is contained in:
Jfreegman 2015-08-10 20:41:11 -04:00
parent 32e541bd1c
commit c39f8909cd
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63

View File

@ -311,7 +311,7 @@ static void chat_resume_file_senders(ToxWindow *self, Tox *m, uint32_t friendnum
if (err != TOX_ERR_FILE_SEND_OK) { if (err != TOX_ERR_FILE_SEND_OK) {
char msg[MAX_STR_SIZE]; char msg[MAX_STR_SIZE];
snprintf(msg, sizeof(msg), "File transfer for '%s' failed.", ft->file_name); snprintf(msg, sizeof(msg), "File transfer for '%s' failed.", ft->file_name);
close_file_transfer(self, m, ft, -1, msg, notif_error); close_file_transfer(self, m, ft, TOX_FILE_CONTROL_CANCEL, msg, notif_error);
continue; continue;
} }
} }
@ -490,7 +490,7 @@ static bool chat_resume_broken_ft(ToxWindow *self, Tox *m, uint32_t friendnum, u
if (!tox_file_seek(m, ft->friendnum, ft->filenum, ft->position, NULL)) if (!tox_file_seek(m, ft->friendnum, ft->filenum, ft->position, NULL))
goto on_error; goto on_error;
if (!tox_file_control(m, friendnum, filenum, TOX_FILE_CONTROL_RESUME, NULL)) if (!tox_file_control(m, ft->friendnum, ft->filenum, TOX_FILE_CONTROL_RESUME, NULL))
goto on_error; goto on_error;
ft->state = FILE_TRANSFER_STARTED; ft->state = FILE_TRANSFER_STARTED;
@ -498,7 +498,7 @@ static bool chat_resume_broken_ft(ToxWindow *self, Tox *m, uint32_t friendnum, u
on_error: on_error:
snprintf(msg, sizeof(msg), "File transfer for '%s' failed.", ft->file_name); snprintf(msg, sizeof(msg), "File transfer for '%s' failed.", ft->file_name);
close_file_transfer(self, m, ft, -1, msg, notif_error); close_file_transfer(self, m, ft, TOX_FILE_CONTROL_CANCEL, msg, notif_error);
return false; return false;
} }