1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-12-22 22:43:25 +01:00

Send file control cancel when we block or delete a friend

This commit is contained in:
jfreegman 2021-12-22 14:53:09 -05:00
parent 6f8f6f0ac5
commit 602d9d97c1
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63
2 changed files with 9 additions and 4 deletions

View File

@ -349,7 +349,11 @@ void close_file_transfer(ToxWindow *self, Tox *m, FileTransfer *ft, int CTRL, co
}
if (CTRL >= 0) {
tox_file_control(m, ft->friendnumber, ft->filenumber, (Tox_File_Control) CTRL, NULL);
Tox_Err_File_Control err;
if (!tox_file_control(m, ft->friendnumber, ft->filenumber, (Tox_File_Control) CTRL, &err)) {
fprintf(stderr, "Failed to cancel file transfer: %d\n", err);
}
}
if (message && self) {

View File

@ -692,6 +692,9 @@ static void select_friend(wint_t key, int *selected, int num)
static void delete_friend(Tox *m, uint32_t f_num)
{
kill_all_file_transfers_friend(m, f_num);
kill_avatar_file_transfers_friend(m, f_num);
Tox_Err_Friend_Delete err;
if (tox_friend_delete(m, f_num, &err) != true) {
@ -840,9 +843,7 @@ void block_friend(Tox *m, uint32_t fnum)
realloc_blocklist(Blocked.max_idx + 1);
clear_blocklist_index(Blocked.max_idx);
int i;
for (i = 0; i <= Blocked.max_idx; ++i) {
for (int i = 0; i <= Blocked.max_idx; ++i) {
if (Blocked.list[i].active) {
continue;
}