1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-05 00:16:44 +02:00

close chatwindow if its associated contact is blocked/deleted

This commit is contained in:
Jfreegman
2014-07-31 21:59:53 -04:00
parent b243f7aa62
commit a223545853
3 changed files with 23 additions and 2 deletions

View File

@ -450,11 +450,20 @@ static void select_friend(ToxWindow *self, wint_t key, int *selected, int num)
static void delete_friend(Tox *m, int32_t f_num)
{
int i;
if (friends[f_num].chatwin >= 0) {
ToxWindow *toxwin = get_window_ptr(friends[f_num].chatwin);
if (toxwin != NULL) {
kill_chat_window(toxwin);
set_active_window(1); /* keep friendlist focused */
}
}
tox_del_friend(m, f_num);
memset(&friends[f_num], 0, sizeof(ToxicFriend));
int i;
for (i = max_friends_index; i > 0; --i) {
if (friends[i - 1].active)
break;