aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--e-util/ChangeLog5
-rw-r--r--e-util/e-account.c31
-rw-r--r--e-util/e-account.h6
3 files changed, 30 insertions, 12 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index 2c680bfcde..cb97b3aa8b 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,3 +1,8 @@
+2003-10-31 Not Zed <NotZed@Ximian.com>
+
+ * e-account.c (e_account_(sg)et_from_xml): add encrypt_key id, and
+ change some of the names around to be more meaningful.
+
2003-10-17 Jeffrey Stedfast <fejj@ximian.com>
* e-host-utils.c (e_gethostbyname_r): If the system defines
diff --git a/e-util/e-account.c b/e-util/e-account.c
index b6e3cdc57f..dbbfccb6e3 100644
--- a/e-util/e-account.c
+++ b/e-util/e-account.c
@@ -98,7 +98,8 @@ finalize (GObject *object)
g_free (account->bcc_addrs);
g_free (account->pgp_key);
- g_free (account->smime_key);
+ g_free (account->smime_sign_key);
+ g_free (account->smime_encrypt_key);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -339,13 +340,16 @@ e_account_set_from_xml (EAccount *account, const char *xml)
}
}
} else if (!strcmp (node->name, "smime")) {
+ changed |= xml_set_bool (node, "sign-default", &account->smime_sign_default);
changed |= xml_set_bool (node, "encrypt-to-self", &account->smime_encrypt_to_self);
- changed |= xml_set_bool (node, "always-sign", &account->smime_always_sign);
+ changed |= xml_set_bool (node, "encrypt-default", &account->smime_encrypt_default);
if (node->children) {
for (cur = node->children; cur; cur = cur->next) {
- if (!strcmp (cur->name, "key-id")) {
- changed |= xml_set_content (cur, &account->smime_key);
+ if (!strcmp (cur->name, "sign-key-id")) {
+ changed |= xml_set_content (cur, &account->smime_sign_key);
+ } else if (!strcmp (cur->name, "encrypt-key-id")) {
+ changed |= xml_set_content (cur, &account->smime_encrypt_key);
break;
}
}
@@ -417,10 +421,14 @@ e_account_import (EAccount *dest, EAccount *src)
dest->pgp_no_imip_sign = src->pgp_no_imip_sign;
dest->pgp_always_trust = src->pgp_always_trust;
- g_free (dest->smime_key);
- dest->smime_key = g_strdup (src->smime_key);
+ dest->smime_sign_default = src->smime_sign_default;
+ g_free (dest->smime_sign_key);
+ dest->smime_sign_key = g_strdup (src->smime_sign_key);
+
+ dest->smime_encrypt_default = src->smime_encrypt_default;
dest->smime_encrypt_to_self = src->smime_encrypt_to_self;
- dest->smime_always_sign = src->smime_always_sign;
+ g_free (dest->smime_encrypt_key);
+ dest->smime_encrypt_key = g_strdup (src->smime_encrypt_key);
}
@@ -500,10 +508,13 @@ e_account_to_xml (EAccount *account)
xmlNewTextChild (node, NULL, "key-id", account->pgp_key);
node = xmlNewChild (root, NULL, "smime", NULL);
+ xmlSetProp (node, "sign-default", account->smime_sign_default ? "true" : "false");
+ xmlSetProp (node, "encrypt-default", account->smime_encrypt_default ? "true" : "false");
xmlSetProp (node, "encrypt-to-self", account->smime_encrypt_to_self ? "true" : "false");
- xmlSetProp (node, "always-sign", account->smime_always_sign ? "true" : "false");
- if (account->smime_key)
- xmlNewTextChild (node, NULL, "key-id", account->smime_key);
+ if (account->smime_sign_key)
+ xmlNewTextChild (node, NULL, "sign-key-id", account->smime_sign_key);
+ if (account->smime_encrypt_key)
+ xmlNewTextChild (node, NULL, "encrypt-key-id", account->smime_encrypt_key);
xmlDocDumpMemory (doc, &xmlbuf, &n);
xmlFreeDoc (doc);
diff --git a/e-util/e-account.h b/e-util/e-account.h
index ff937b3905..e50c773991 100644
--- a/e-util/e-account.h
+++ b/e-util/e-account.h
@@ -72,9 +72,11 @@ typedef struct {
gboolean pgp_no_imip_sign;
gboolean pgp_always_trust;
- char *smime_key;
+ char *smime_sign_key;
+ char *smime_encrypt_key;
+ gboolean smime_sign_default;
gboolean smime_encrypt_to_self;
- gboolean smime_always_sign;
+ gboolean smime_encrypt_default;
} EAccount;
typedef struct {