aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-06-22 12:56:32 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-06-22 12:56:32 +0800
commitef162bbe12e04d53a830a7a709988c24f437009d (patch)
tree7b6323880706bf1d92fe6dd8affc999725c28036
parent34993bc0feaa65d15ccc57d49b448b7ad8815775 (diff)
downloadgsoc2013-evolution-ef162bbe12e04d53a830a7a709988c24f437009d.tar
gsoc2013-evolution-ef162bbe12e04d53a830a7a709988c24f437009d.tar.gz
gsoc2013-evolution-ef162bbe12e04d53a830a7a709988c24f437009d.tar.bz2
gsoc2013-evolution-ef162bbe12e04d53a830a7a709988c24f437009d.tar.lz
gsoc2013-evolution-ef162bbe12e04d53a830a7a709988c24f437009d.tar.xz
gsoc2013-evolution-ef162bbe12e04d53a830a7a709988c24f437009d.tar.zst
gsoc2013-evolution-ef162bbe12e04d53a830a7a709988c24f437009d.zip
Use the new gpg cipher context rather than the old pgp context.
2002-06-21 Jeffrey Stedfast <fejj@ximian.com> * e-msg-composer.c (build_message): Use the new gpg cipher context rather than the old pgp context. svn path=/trunk/; revision=17254
-rw-r--r--composer/ChangeLog5
-rw-r--r--composer/e-msg-composer.c47
2 files changed, 30 insertions, 22 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index 9a325409bc..39188aa160 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,8 @@
+2002-06-21 Jeffrey Stedfast <fejj@ximian.com>
+
+ * e-msg-composer.c (build_message): Use the new gpg cipher context
+ rather than the old pgp context.
+
2002-06-19 Radek Doulik <rodo@ximian.com>
* e-msg-composer.c (get_signature_html): don't convert text to
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index c4f72db93a..51be07c925 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -498,14 +498,15 @@ build_message (EMsgComposer *composer)
CamelInternetAddress *from = NULL;
const char *pgpid;
CamelMultipartSigned *mps;
- CamelCipherContext *context;
-
- context = (CamelCipherContext *)camel_pgp_context_new(session, mail_config_get_pgp_type(), mail_config_get_pgp_path());
- if (context == NULL) {
- camel_exception_setv(&ex, CAMEL_EXCEPTION_SYSTEM, _("Could not create a PGP signature context"));
+ CamelCipherContext *cipher;
+
+ cipher = camel_gpg_context_new (session, mail_config_get_pgp_path ());
+ if (cipher == NULL) {
+ camel_exception_setv (&ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not create a PGP signature context"));
goto exception;
}
-
+
if (hdrs->account && hdrs->account->pgp_key && *hdrs->account->pgp_key) {
pgpid = hdrs->account->pgp_key;
} else {
@@ -514,28 +515,30 @@ build_message (EMsgComposer *composer)
camel_internet_address_get (from, 0, NULL, &pgpid);
}
- mps = camel_multipart_signed_new();
- camel_multipart_signed_sign(mps, context, part, pgpid, CAMEL_CIPHER_HASH_SHA1, &ex);
-
+ mps = camel_multipart_signed_new ();
+ camel_multipart_signed_sign (mps, cipher, part, pgpid, CAMEL_CIPHER_HASH_SHA1, &ex);
+
if (from)
camel_object_unref (CAMEL_OBJECT (from));
-
+
/* if cancelled, just leave part as is, otherwise, replace content with the multipart */
- if (camel_exception_is_set(&ex)) {
- if (camel_exception_get_id(&ex) == CAMEL_EXCEPTION_USER_CANCEL) {
- camel_exception_clear(&ex);
+ if (camel_exception_is_set (&ex)) {
+ if (camel_exception_get_id (&ex) == CAMEL_EXCEPTION_USER_CANCEL) {
+ camel_exception_clear (&ex);
} else {
- camel_object_unref((CamelObject *)mps);
- camel_object_unref((CamelObject *)context);
+ camel_object_unref (CAMEL_OBJECT (mps));
+ camel_object_unref (CAMEL_OBJECT (cipher));
goto exception;
}
} else {
- camel_medium_set_content_object(CAMEL_MEDIUM (part), (CamelDataWrapper *)mps);
+ camel_multipart_set_boundary (CAMEL_MULTIPART (mps), NULL);
+ camel_medium_set_content_object (CAMEL_MEDIUM (part), (CamelDataWrapper *) mps);
}
- camel_object_unref((CamelObject *)mps);
- camel_object_unref((CamelObject *)context);
+
+ camel_object_unref (CAMEL_OBJECT (mps));
+ camel_object_unref (CAMEL_OBJECT (cipher));
}
-
+
if (composer->pgp_encrypt) {
/* FIXME: recipients should be an array of key ids rather than email addresses */
const CamelInternetAddress *addr;
@@ -589,9 +592,9 @@ build_message (EMsgComposer *composer)
for (i = 0; i < recipients->len; i++)
g_free (recipients->pdata[i]);
g_ptr_array_free (recipients, TRUE);
-
- if (camel_exception_is_set(&ex)
- && camel_exception_get_id(&ex) != CAMEL_EXCEPTION_USER_CANCEL)
+
+ if (camel_exception_is_set (&ex)
+ && camel_exception_get_id (&ex) != CAMEL_EXCEPTION_USER_CANCEL)
goto exception;
}