Fixed group chats not being deleted on close.

This commit is contained in:
Håvard Pettersson 2014-11-19 06:15:04 +01:00
parent 54c6908c4e
commit 92859ce6fc
1 changed files with 11 additions and 0 deletions

View File

@ -330,6 +330,17 @@ twc_chat_buffer_close_callback(void *data,
{
struct t_twc_chat *chat = data;
if (chat->profile->tox && chat->group_number >= 0)
{
int rc = tox_del_groupchat(chat->profile->tox, chat->group_number);
if (rc != 0)
{
weechat_printf(chat->profile->buffer,
"%swarning: failed to leave group chat",
weechat_prefix("error"));
}
}
twc_list_remove_with_data(chat->profile->chats, chat);
twc_chat_free(chat);