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

Load conference titles on startup for saved conferences (#43)

This commit is contained in:
JFreegman
2019-06-30 14:51:13 -04:00
committed by GitHub
parent 12b9cd2386
commit bb2257973e
7 changed files with 27 additions and 6 deletions

View File

@ -344,7 +344,23 @@ static void load_groups(ToxWindow *prompt, Tox *m)
continue;
}
if (init_groupchat_win(prompt, m, groupnum, type) == -1) {
Tox_Err_Conference_Title t_err;
size_t length = tox_conference_get_title_size(m, groupnum, &t_err);
uint8_t title[MAX_STR_SIZE];
if (t_err != TOX_ERR_CONFERENCE_TITLE_OK || length >= sizeof(title)) {
length = 0;
} else {
tox_conference_get_title(m, groupnum, title, &t_err);
if (t_err != TOX_ERR_CONFERENCE_TITLE_OK) {
length = 0;
}
}
title[length] = 0;
if (init_groupchat_win(prompt, m, groupnum, type, (const char *) title, length) == -1) {
tox_conference_delete(m, groupnum, NULL);
continue;
}