about summary refs log tree commit diff stats
path: root/src/config
diff options
context:
space:
mode:
Diffstat (limited to 'src/config')
-rw-r--r--src/config/account.c19
-rw-r--r--src/config/account.h5
-rw-r--r--src/config/accounts.c3
-rw-r--r--src/config/accounts.h2
-rw-r--r--src/config/conflists.c2
-rw-r--r--src/config/conflists.h2
-rw-r--r--src/config/files.c2
-rw-r--r--src/config/files.h2
-rw-r--r--src/config/preferences.c12
-rw-r--r--src/config/preferences.h4
-rw-r--r--src/config/scripts.c2
-rw-r--r--src/config/scripts.h2
-rw-r--r--src/config/theme.c4
-rw-r--r--src/config/theme.h2
-rw-r--r--src/config/tlscerts.c2
-rw-r--r--src/config/tlscerts.h2
16 files changed, 44 insertions, 23 deletions
diff --git a/src/config/account.c b/src/config/account.c
index 705a5edf..93ba5078 100644
--- a/src/config/account.c
+++ b/src/config/account.c
@@ -1,7 +1,7 @@
 /*
  * account.c
  *
- * Copyright (C) 2012 - 2018 James Booth <boothj5@gmail.com>
+ * Copyright (C) 2012 - 2019 James Booth <boothj5@gmail.com>
  *
  * This file is part of Profanity.
  *
@@ -241,3 +241,20 @@ account_free(ProfAccount *account)
     g_list_free_full(account->otr_always, g_free);
     free(account);
 }
+
+void account_set_server(ProfAccount *account, const char *server)
+{
+    free(account->server);
+    account->server = strdup(server);
+}
+
+void account_set_port(ProfAccount *account, int port)
+{
+    account->port = port;
+}
+
+void account_set_tls_policy(ProfAccount *account, const char *tls_policy)
+{
+    free(account->tls_policy);
+    account->tls_policy = strdup(tls_policy);
+}
diff --git a/src/config/account.h b/src/config/account.h
index 1262e518..68264c47 100644
--- a/src/config/account.h
+++ b/src/config/account.h
@@ -1,7 +1,7 @@
 /*
  * account.h
  *
- * Copyright (C) 2012 - 2018 James Booth <boothj5@gmail.com>
+ * Copyright (C) 2012 - 2019 James Booth <boothj5@gmail.com>
  *
  * This file is part of Profanity.
  *
@@ -77,5 +77,8 @@ ProfAccount* account_new(const gchar *const name, const gchar *const jid,
 char* account_create_connect_jid(ProfAccount *account);
 gboolean account_eval_password(ProfAccount *account);
 void account_free(ProfAccount *account);
+void account_set_server(ProfAccount *account, const char *server);
+void account_set_port(ProfAccount *account, int port);
+void account_set_tls_policy(ProfAccount *account, const char *tls_policy);
 
 #endif
diff --git a/src/config/accounts.c b/src/config/accounts.c
index de898dd7..f53f53c9 100644
--- a/src/config/accounts.c
+++ b/src/config/accounts.c
@@ -1,7 +1,7 @@
 /*
  * accounts.c
  *
- * Copyright (C) 2012 - 2018 James Booth <boothj5@gmail.com>
+ * Copyright (C) 2012 - 2019 James Booth <boothj5@gmail.com>
  *
  * This file is part of Profanity.
  *
@@ -291,6 +291,7 @@ accounts_get_account(const char *const name)
         gchar *tls_policy = g_key_file_get_string(accounts, name, "tls.policy", NULL);
         if (tls_policy && ((g_strcmp0(tls_policy, "force") != 0) &&
                 (g_strcmp0(tls_policy, "allow") != 0) &&
+                (g_strcmp0(tls_policy, "trust") != 0) &&
                 (g_strcmp0(tls_policy, "disable") != 0) &&
                 (g_strcmp0(tls_policy, "legacy") != 0))) {
             g_free(tls_policy);
diff --git a/src/config/accounts.h b/src/config/accounts.h
index c6a87c44..d41fb53e 100644
--- a/src/config/accounts.h
+++ b/src/config/accounts.h
@@ -1,7 +1,7 @@
 /*
  * accounts.h
  *
- * Copyright (C) 2012 - 2018 James Booth <boothj5@gmail.com>
+ * Copyright (C) 2012 - 2019 James Booth <boothj5@gmail.com>
  *
  * This file is part of Profanity.
  *
diff --git a/src/config/conflists.c b/src/config/conflists.c
index 0d368757..e6416924 100644
--- a/src/config/conflists.c
+++ b/src/config/conflists.c
@@ -1,7 +1,7 @@
 /*
  * conflists.c
  *
- * Copyright (C) 2012 - 2018 James Booth <boothj5@gmail.com>
+ * Copyright (C) 2012 - 2019 James Booth <boothj5@gmail.com>
  *
  * This file is part of Profanity.
  *
diff --git a/src/config/conflists.h b/src/config/conflists.h
index 0e46fb00..3b653834 100644
--- a/src/config/conflists.h
+++ b/src/config/conflists.h
@@ -1,7 +1,7 @@
 /*
  * conflists.h
  *
- * Copyright (C) 2012 - 2018 James Booth <boothj5@gmail.com>
+ * Copyright (C) 2012 - 2019 James Booth <boothj5@gmail.com>
  *
  * This file is part of Profanity.
  *
diff --git a/src/config/files.c b/src/config/files.c
index e8de2edb..cd1c914f 100644
--- a/src/config/files.c
+++ b/src/config/files.c
@@ -1,7 +1,7 @@
 /*
  * files.c
  *
- * Copyright (C) 2012 - 2018 James Booth <boothj5@gmail.com>
+ * Copyright (C) 2012 - 2019 James Booth <boothj5@gmail.com>
  *
  * This file is part of Profanity.
  *
diff --git a/src/config/files.h b/src/config/files.h
index 2eec9772..1d8d2890 100644
--- a/src/config/files.h
+++ b/src/config/files.h
@@ -1,7 +1,7 @@
 /*
  * files.h
  *
- * Copyright (C) 2012 - 2018 James Booth <boothj5@gmail.com>
+ * Copyright (C) 2012 - 2019 James Booth <boothj5@gmail.com>
  *
  * This file is part of Profanity.
  *
diff --git a/src/config/preferences.c b/src/config/preferences.c
index e62c552c..265e11db 100644
--- a/src/config/preferences.c
+++ b/src/config/preferences.c
@@ -1,7 +1,7 @@
 /*
  * preferences.c
  *
- * Copyright (C) 2012 - 2018 James Booth <boothj5@gmail.com>
+ * Copyright (C) 2012 - 2019 James Booth <boothj5@gmail.com>
  *
  * This file is part of Profanity.
  *
@@ -123,7 +123,7 @@ prefs_load(void)
         g_key_file_set_string(prefs, PREF_GROUP_UI, "time.console", val);
         g_key_file_set_string(prefs, PREF_GROUP_UI, "time.chat", val);
         g_key_file_set_string(prefs, PREF_GROUP_UI, "time.muc", val);
-        g_key_file_set_string(prefs, PREF_GROUP_UI, "time.mucconfig", val);
+        g_key_file_set_string(prefs, PREF_GROUP_UI, "time.config", val);
         g_key_file_set_string(prefs, PREF_GROUP_UI, "time.private", val);
         g_key_file_set_string(prefs, PREF_GROUP_UI, "time.xmlconsole", val);
         g_key_file_remove_key(prefs, PREF_GROUP_UI, "time", NULL);
@@ -1567,7 +1567,7 @@ _get_group(preference_t pref)
         case PREF_TIME_CONSOLE:
         case PREF_TIME_CHAT:
         case PREF_TIME_MUC:
-        case PREF_TIME_MUCCONFIG:
+        case PREF_TIME_CONFIG:
         case PREF_TIME_PRIVATE:
         case PREF_TIME_XMLCONSOLE:
         case PREF_TIME_STATUSBAR:
@@ -1777,8 +1777,8 @@ _get_key(preference_t pref)
             return "time.chat";
         case PREF_TIME_MUC:
             return "time.muc";
-        case PREF_TIME_MUCCONFIG:
-            return "time.mucconfig";
+        case PREF_TIME_CONFIG:
+            return "time.config";
         case PREF_TIME_PRIVATE:
             return "time.private";
         case PREF_TIME_XMLCONSOLE:
@@ -1967,7 +1967,7 @@ _get_default_string(preference_t pref)
             return "%H:%M:%S";
         case PREF_TIME_MUC:
             return "%H:%M:%S";
-        case PREF_TIME_MUCCONFIG:
+        case PREF_TIME_CONFIG:
             return "%H:%M:%S";
         case PREF_TIME_PRIVATE:
             return "%H:%M:%S";
diff --git a/src/config/preferences.h b/src/config/preferences.h
index bafe4a1f..65dee327 100644
--- a/src/config/preferences.h
+++ b/src/config/preferences.h
@@ -1,7 +1,7 @@
 /*
  * preferences.h
  *
- * Copyright (C) 2012 - 2018 James Booth <boothj5@gmail.com>
+ * Copyright (C) 2012 - 2019 James Booth <boothj5@gmail.com>
  *
  * This file is part of Profanity.
  *
@@ -92,7 +92,7 @@ typedef enum {
     PREF_TIME_CONSOLE,
     PREF_TIME_CHAT,
     PREF_TIME_MUC,
-    PREF_TIME_MUCCONFIG,
+    PREF_TIME_CONFIG,
     PREF_TIME_PRIVATE,
     PREF_TIME_XMLCONSOLE,
     PREF_TIME_STATUSBAR,
diff --git a/src/config/scripts.c b/src/config/scripts.c
index 5980dcaa..aea914b4 100644
--- a/src/config/scripts.c
+++ b/src/config/scripts.c
@@ -1,7 +1,7 @@
 /*
  * scripts.c
  *
- * Copyright (C) 2012 - 2018 James Booth <boothj5@gmail.com>
+ * Copyright (C) 2012 - 2019 James Booth <boothj5@gmail.com>
  *
  * This file is part of Profanity.
  *
diff --git a/src/config/scripts.h b/src/config/scripts.h
index 508a43c2..ef306c37 100644
--- a/src/config/scripts.h
+++ b/src/config/scripts.h
@@ -1,7 +1,7 @@
 /*
  * scripts.h
  *
- * Copyright (C) 2012 - 2018 James Booth <boothj5@gmail.com>
+ * Copyright (C) 2012 - 2019 James Booth <boothj5@gmail.com>
  *
  * This file is part of Profanity.
  *
diff --git a/src/config/theme.c b/src/config/theme.c
index 13f9cc2b..a94cfb21 100644
--- a/src/config/theme.c
+++ b/src/config/theme.c
@@ -1,7 +1,7 @@
 /*
  * theme.c
  *
- * Copyright (C) 2012 - 2018 James Booth <boothj5@gmail.com>
+ * Copyright (C) 2012 - 2019 James Booth <boothj5@gmail.com>
  *
  * This file is part of Profanity.
  *
@@ -413,7 +413,7 @@ _load_preferences(void)
     _set_string_preference("time.console", PREF_TIME_CONSOLE);
     _set_string_preference("time.chat", PREF_TIME_CHAT);
     _set_string_preference("time.muc", PREF_TIME_MUC);
-    _set_string_preference("time.mucconfig", PREF_TIME_MUCCONFIG);
+    _set_string_preference("time.config", PREF_TIME_CONFIG);
     _set_string_preference("time.private", PREF_TIME_PRIVATE);
     _set_string_preference("time.xmlconsole", PREF_TIME_XMLCONSOLE);
     _set_string_preference("time.statusbar", PREF_TIME_STATUSBAR);
diff --git a/src/config/theme.h b/src/config/theme.h
index c1d9870e..69584b30 100644
--- a/src/config/theme.h
+++ b/src/config/theme.h
@@ -1,7 +1,7 @@
 /*
  * theme.h
  *
- * Copyright (C) 2012 - 2018 James Booth <boothj5@gmail.com>
+ * Copyright (C) 2012 - 2019 James Booth <boothj5@gmail.com>
  *
  * This file is part of Profanity.
  *
diff --git a/src/config/tlscerts.c b/src/config/tlscerts.c
index 23f6575c..95a256b5 100644
--- a/src/config/tlscerts.c
+++ b/src/config/tlscerts.c
@@ -1,7 +1,7 @@
 /*
  * tlscerts.c
  *
- * Copyright (C) 2012 - 2018 James Booth <boothj5@gmail.com>
+ * Copyright (C) 2012 - 2019 James Booth <boothj5@gmail.com>
  *
  * This file is part of Profanity.
  *
diff --git a/src/config/tlscerts.h b/src/config/tlscerts.h
index 2fd568ad..fcde7db0 100644
--- a/src/config/tlscerts.h
+++ b/src/config/tlscerts.h
@@ -1,7 +1,7 @@
 /*
  * tlscerts.h
  *
- * Copyright (C) 2012 - 2018 James Booth <boothj5@gmail.com>
+ * Copyright (C) 2012 - 2019 James Booth <boothj5@gmail.com>
  *
  * This file is part of Profanity.
  *