about summary refs log tree commit diff stats
path: root/src/config
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-12-08 23:36:00 +0000
committerJames Booth <boothj5@gmail.com>2013-12-08 23:36:00 +0000
commit1c2661f1c3d5750f8f82f0b51b42eb64093e6d58 (patch)
tree1b90e751c8cb65fef9921461fb12f1690f3c9432 /src/config
parent3ce0d0f87770dbe9c992be76dc9bafa558c3f89b (diff)
downloadprofani-tty-1c2661f1c3d5750f8f82f0b51b42eb64093e6d58.tar.gz
Added clear command to /account for password clearing
fixes #267
Diffstat (limited to 'src/config')
-rw-r--r--src/config/accounts.c9
-rw-r--r--src/config/accounts.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/src/config/accounts.c b/src/config/accounts.c
index 6bfc7bef..0422a991 100644
--- a/src/config/accounts.c
+++ b/src/config/accounts.c
@@ -444,6 +444,15 @@ accounts_set_password(const char * const account_name, const char * const value)
 }
 
 void
+accounts_clear_password(const char * const account_name)
+{
+    if (accounts_account_exists(account_name)) {
+        g_key_file_remove_key(accounts, account_name, "password", NULL);
+        _save_accounts();
+    }
+}
+
+void
 accounts_set_muc_service(const char * const account_name, const char * const value)
 {
     if (accounts_account_exists(account_name)) {
diff --git a/src/config/accounts.h b/src/config/accounts.h
index 118b5c80..96289952 100644
--- a/src/config/accounts.h
+++ b/src/config/accounts.h
@@ -80,5 +80,6 @@ void accounts_set_priority_dnd(const char * const account_name, const gint value
 void accounts_set_priority_all(const char * const account_name, const gint value);
 gint accounts_get_priority_for_presence_type(const char * const account_name,
     resource_presence_t presence_type);
+void accounts_clear_password(const char * const account_name);
 
 #endif