1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-12-08 01:16:35 +01:00

add support for group persistence

This commit is contained in:
Jfreegman
2015-02-27 19:03:53 -05:00
parent b31bd93e7d
commit 830ddb21b5
4 changed files with 22 additions and 5 deletions

View File

@@ -47,6 +47,7 @@
#include "toxic.h"
#include "windows.h"
#include "friendlist.h"
#include "groupchat.h"
#include "prompt.h"
#include "misc_tools.h"
#include "file_senders.h"
@@ -481,6 +482,17 @@ static void load_friendlist(Tox *m)
sort_friendlist_index();
}
static void load_groups(Tox *m)
{
uint32_t i;
uint32_t numgroups = tox_group_count_groups(m);
for (i = 0; i < numgroups; ++i) {
if (init_groupchat_win(m, i, NULL, 0) == -1)
tox_group_delete(m, i, NULL, 0);
}
}
/* return length of password on success, 0 on failure */
static int password_prompt(char *buf, int size)
{
@@ -1109,6 +1121,7 @@ int main(int argc, char *argv[])
if (settings_err == -1)
queue_init_message("Failed to load user settings");
load_groups(m);
print_init_messages(prompt);
cleanup_init_messages();