about summary refs log tree commit diff stats
path: root/src/config
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-05-23 22:29:41 +0100
committerJames Booth <boothj5@gmail.com>2013-05-23 22:29:41 +0100
commit4d9148e73462bbbb8fe579d1cca48f6795c38286 (patch)
treea78b51cadeae68377026043445ff95ba34a69707 /src/config
parent486cbd62450c1ba51aab3046f3c55c6f5890eb96 (diff)
downloadprofani-tty-4d9148e73462bbbb8fe579d1cca48f6795c38286.tar.gz
Added rooms history to ProfAccount
Diffstat (limited to 'src/config')
-rw-r--r--src/config/accounts.c16
-rw-r--r--src/config/accounts.h1
2 files changed, 17 insertions, 0 deletions
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);