From 4d9148e73462bbbb8fe579d1cca48f6795c38286 Mon Sep 17 00:00:00 2001 From: James Booth Date: Thu, 23 May 2013 22:29:41 +0100 Subject: Added rooms history to ProfAccount --- src/config/accounts.c | 16 ++++++++++++++++ src/config/accounts.h | 1 + 2 files changed, 17 insertions(+) (limited to 'src/config') diff --git a/src/config/accounts.c b/src/config/accounts.c index b53f4fb0..876ff870 100644 --- a/src/config/accounts.c +++ b/src/config/accounts.c @@ -212,6 +212,22 @@ accounts_get_account(const char * const name) account->priority_xa = g_key_file_get_integer(accounts, name, "priority.xa", NULL); account->priority_dnd = g_key_file_get_integer(accounts, name, "priority.dnd", NULL); + // get room history + account->room_history = NULL; + gsize history_size = 0; + gchar **room_history_values = g_key_file_get_string_list(accounts, name, + "rooms.history", &history_size, NULL); + + if (room_history_values != NULL) { + int i = 0; + for (i = 0; i < history_size; i++) { + account->room_history = g_slist_append(account->room_history, + strdup(room_history_values[i])); + } + + g_strfreev(room_history_values); + } + return account; } } diff --git a/src/config/accounts.h b/src/config/accounts.h index d1509d6f..d74e8fe5 100644 --- a/src/config/accounts.h +++ b/src/config/accounts.h @@ -38,6 +38,7 @@ typedef struct prof_account_t { gint priority_xa; gint priority_dnd; gboolean enabled; + GSList *room_history; } ProfAccount; void accounts_load(void); -- cgit 1.4.1-2-gfad0