mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-22 07:33:02 +01:00
Send file control cancel when we block or delete a friend
This commit is contained in:
parent
6f8f6f0ac5
commit
602d9d97c1
@ -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) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user