mirror of
https://github.com/Tha14/toxic.git
synced 2025-07-04 23:56:45 +02:00
core API update and refactor group invites a bit
This commit is contained in:
@ -112,6 +112,13 @@ static void realloc_blocklist(int n)
|
||||
|
||||
void kill_friendlist(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i <= Friends.max_idx; ++i) {
|
||||
if (Friends.list[i].group_invite.key != NULL)
|
||||
free(Friends.list[i].group_invite.key);
|
||||
}
|
||||
|
||||
realloc_blocklist(0);
|
||||
realloc_friends(0);
|
||||
}
|
||||
@ -478,7 +485,7 @@ static void friendlist_onFileSendRequest(ToxWindow *self, Tox *m, int32_t num, u
|
||||
}
|
||||
}
|
||||
|
||||
static void friendlist_onGroupInvite(ToxWindow *self, Tox *m, int32_t num, const char *group_pub_key)
|
||||
static void friendlist_onGroupInvite(ToxWindow *self, Tox *m, int32_t num, const char *group_pub_key, uint16_t length)
|
||||
{
|
||||
if (num >= Friends.max_idx)
|
||||
return;
|
||||
@ -521,6 +528,9 @@ static void delete_friend(Tox *m, int32_t f_num)
|
||||
}
|
||||
}
|
||||
|
||||
if (Friends.list[f_num].group_invite.key != NULL)
|
||||
free(Friends.list[f_num].group_invite.key);
|
||||
|
||||
tox_del_friend(m, f_num);
|
||||
memset(&Friends.list[f_num], 0, sizeof(ToxicFriend));
|
||||
|
||||
|
Reference in New Issue
Block a user