Only use non-NULL contexts. (mail_crypto_pgp_mime_part_encrypt): Same.

2001-04-14  Jeffrey Stedfast  <fejj@ximian.com>

	* mail-crypto.c (mail_crypto_pgp_mime_part_verify): Only use
	non-NULL contexts.
	(mail_crypto_pgp_mime_part_encrypt): Same.
	(mail_crypto_pgp_mime_part_decrypt): And here too.

	* mail-format.c (try_inline_pgp_sig): Make sure to not use the
	context if it is NULL.
	(decode_pgp): Same.

	* folder-browser-factory.c: Added stuff for filtering/vfoldering
	on mailinglists.

svn path=/trunk/; revision=9315
This commit is contained in:
Jeffrey Stedfast
2001-04-14 21:24:07 +00:00
committed by Jeffrey Stedfast
parent 6dce8c2f32
commit 4e3776a37d
6 changed files with 72 additions and 38 deletions

View File

@ -1,3 +1,17 @@
2001-04-14 Jeffrey Stedfast <fejj@ximian.com>
* mail-crypto.c (mail_crypto_pgp_mime_part_verify): Only use
non-NULL contexts.
(mail_crypto_pgp_mime_part_encrypt): Same.
(mail_crypto_pgp_mime_part_decrypt): And here too.
* mail-format.c (try_inline_pgp_sig): Make sure to not use the
context if it is NULL.
(decode_pgp): Same.
* folder-browser-factory.c: Added stuff for filtering/vfoldering
on mailinglists.
2001-04-13 Dan Winship <danw@ximian.com>
* Makefile.am (evolution_mail_LDADD): Remove some redundant LIBS

View File

@ -68,7 +68,7 @@ BonoboUIVerb verbs [] = {
BONOBO_UI_UNSAFE_VERB ("MessageResend", resend_msg),
BONOBO_UI_UNSAFE_VERB ("MessageSaveAs", save_msg),
BONOBO_UI_UNSAFE_VERB ("MessagePrint", print_msg),
BONOBO_UI_UNSAFE_VERB ("MessageReplySndr", reply_to_sender),
BONOBO_UI_UNSAFE_VERB ("MessageReplySender", reply_to_sender),
BONOBO_UI_UNSAFE_VERB ("MessageReplyAll", reply_to_all),
BONOBO_UI_UNSAFE_VERB ("MessageForwardAttached", forward_attached),
BONOBO_UI_UNSAFE_VERB ("MessageForwardInlined", forward_inlined),
@ -87,13 +87,15 @@ BonoboUIVerb verbs [] = {
BONOBO_UI_UNSAFE_VERB ("MessageApplyFilters", apply_filters),
BONOBO_UI_UNSAFE_VERB ("MessageVFolderSubj", vfolder_subject),
BONOBO_UI_UNSAFE_VERB ("MessageVFolderSndr", vfolder_sender),
BONOBO_UI_UNSAFE_VERB ("MessageVFolderRecip", vfolder_recipient),
BONOBO_UI_UNSAFE_VERB ("MessageVFolderSubject", vfolder_subject),
BONOBO_UI_UNSAFE_VERB ("MessageVFolderSender", vfolder_sender),
BONOBO_UI_UNSAFE_VERB ("MessageVFolderRecipient", vfolder_recipient),
BONOBO_UI_UNSAFE_VERB ("MessageVFolderMailingList", vfolder_mlist),
BONOBO_UI_UNSAFE_VERB ("MessageFilterSubj", filter_subject),
BONOBO_UI_UNSAFE_VERB ("MessageFilterSndr", filter_sender),
BONOBO_UI_UNSAFE_VERB ("MessageFilterRecip", filter_recipient),
BONOBO_UI_UNSAFE_VERB ("MessageFilterSubject", filter_subject),
BONOBO_UI_UNSAFE_VERB ("MessageFilterSender", filter_sender),
BONOBO_UI_UNSAFE_VERB ("MessageFilterRecipient", filter_recipient),
BONOBO_UI_UNSAFE_VERB ("MessageFilterMailingList", filter_mlist),
BONOBO_UI_UNSAFE_VERB ("MessageHideClear", hide_none),
BONOBO_UI_UNSAFE_VERB ("MessageHideRead", hide_read),
@ -103,7 +105,7 @@ BonoboUIVerb verbs [] = {
/* Folder Menu */
BONOBO_UI_UNSAFE_VERB ("FolderExpunge", expunge_folder),
BONOBO_UI_UNSAFE_VERB ("FolderConfig", configure_folder),
BONOBO_UI_UNSAFE_VERB ("ActionsEmptyTrash", empty_trash),
BONOBO_UI_UNSAFE_VERB ("EmptyTrash", empty_trash),
/* Toolbar specific */
BONOBO_UI_UNSAFE_VERB ("MailStop", stop_threads),
@ -130,7 +132,7 @@ static EPixmap pixcache [] = {
E_PIXMAP ("/menu/Actions/Component/SendReceive", "send-receive.xpm"),
E_PIXMAP ("/menu/Actions/Component/MessageMove", "move_message.xpm"),
E_PIXMAP ("/menu/Actions/Component/MessageReplyAll", "reply_to_all.xpm"),
E_PIXMAP ("/menu/Actions/Component/MessageReplySndr", "reply.xpm"),
E_PIXMAP ("/menu/Actions/Component/MessageReplySender", "reply.xpm"),
E_PIXMAP ("/menu/Tools/Component/SetMailConfig", "configure_16_mail.xpm"),

View File

@ -154,13 +154,16 @@ mail_crypto_pgp_mime_part_sign (CamelMimePart **mime_part, const char *userid, C
CamelCipherValidity *
mail_crypto_pgp_mime_part_verify (CamelMimePart *mime_part, CamelException *ex)
{
CamelCipherValidity *valid = NULL;
CamelPgpContext *context;
CamelCipherValidity *valid;
context = camel_pgp_context_new (session, mail_config_get_pgp_type (),
mail_config_get_pgp_path ());
valid = camel_pgp_mime_part_verify (context, mime_part, ex);
camel_object_unref (CAMEL_OBJECT (context));
if (context) {
valid = camel_pgp_mime_part_verify (context, mime_part, ex);
camel_object_unref (CAMEL_OBJECT (context));
}
return valid;
}
@ -183,8 +186,11 @@ mail_crypto_pgp_mime_part_encrypt (CamelMimePart **mime_part, GPtrArray *recipie
context = camel_pgp_context_new (session, mail_config_get_pgp_type (),
mail_config_get_pgp_path ());
camel_pgp_mime_part_encrypt (context, mime_part, recipients, ex);
camel_object_unref (CAMEL_OBJECT (context));
if (context) {
camel_pgp_mime_part_encrypt (context, mime_part, recipients, ex);
camel_object_unref (CAMEL_OBJECT (context));
}
}
@ -199,12 +205,15 @@ CamelMimePart *
mail_crypto_pgp_mime_part_decrypt (CamelMimePart *mime_part, CamelException *ex)
{
CamelPgpContext *context;
CamelMimePart *part;
CamelMimePart *part = NULL;
context = camel_pgp_context_new (session, mail_config_get_pgp_type (),
mail_config_get_pgp_path ());
part = camel_pgp_mime_part_decrypt (context, mime_part, ex);
camel_object_unref (CAMEL_OBJECT (context));
if (context) {
part = camel_pgp_mime_part_decrypt (context, mime_part, ex);
camel_object_unref (CAMEL_OBJECT (context));
}
return part;
}

View File

@ -1027,9 +1027,14 @@ decode_pgp (CamelStream *ciphertext, CamelStream *plaintext, MailDisplay *md)
ctx = camel_pgp_context_new (session, mail_config_get_pgp_type (),
mail_config_get_pgp_path ());
camel_pgp_decrypt (ctx, ciphertext, plaintext, &ex);
camel_object_unref (CAMEL_OBJECT (ctx));
camel_stream_reset (plaintext);
if (ctx) {
camel_pgp_decrypt (ctx, ciphertext, plaintext, &ex);
camel_object_unref (CAMEL_OBJECT (ctx));
camel_stream_reset (plaintext);
} else {
camel_exception_setv (&ex, CAMEL_EXCEPTION_SYSTEM,
_("No GPG/PGP program configured."));
}
if (!camel_exception_is_set (&ex))
return;
@ -1040,7 +1045,7 @@ decode_pgp (CamelStream *ciphertext, CamelStream *plaintext, MailDisplay *md)
"<a href=\"x-evolution-decode-pgp:\">"
"<img src=\"%s\"></a></td><td>",
get_url_for_icon ("gnome-lockscreen.png", md));
if (camel_exception_is_set (&ex)) {
mail_html_write (md->html, md->stream, "%s<br><br>\n",
_("Encrypted message not displayed"));
@ -1052,7 +1057,7 @@ decode_pgp (CamelStream *ciphertext, CamelStream *plaintext, MailDisplay *md)
_("Encrypted message"),
_("Click icon to decrypt."));
}
mail_html_write (md->html, md->stream, "</td></tr></table>");
}
@ -1099,10 +1104,8 @@ try_inline_pgp (char *start, MailDisplay *md)
static char *
try_inline_pgp_sig (char *start, MailDisplay *md)
{
CamelCipherValidity *valid = NULL;
CamelPgpContext *context;
CamelStream *ciphertext;
CamelCipherValidity *valid;
CamelException *ex;
char *end;
end = strstr (start, "-----END PGP SIGNATURE-----");
@ -1116,14 +1119,22 @@ try_inline_pgp_sig (char *start, MailDisplay *md)
context = camel_pgp_context_new (session, mail_config_get_pgp_type (),
mail_config_get_pgp_path ());
ciphertext = camel_stream_mem_new ();
camel_stream_write (ciphertext, start, end - start);
camel_stream_reset (ciphertext);
ex = camel_exception_new ();
valid = camel_pgp_verify (context, ciphertext, NULL, ex);
camel_object_unref (CAMEL_OBJECT (ciphertext));
camel_object_unref (CAMEL_OBJECT (context));
if (context) {
CamelStream *ciphertext;
CamelException *ex;
ex = camel_exception_new ();
ciphertext = camel_stream_mem_new ();
camel_stream_write (ciphertext, start, end - start);
camel_stream_reset (ciphertext);
valid = camel_pgp_verify (context, ciphertext, NULL, ex);
camel_object_unref (CAMEL_OBJECT (ciphertext));
camel_object_unref (CAMEL_OBJECT (context));
camel_exception_free (ex);
}
mail_text_write (md->html, md->stream, "%.*s", end - start, start);
@ -1154,7 +1165,6 @@ try_inline_pgp_sig (char *start, MailDisplay *md)
mail_html_write (md->html, md->stream, "</font></td></table>");
camel_exception_free (ex);
camel_cipher_validity_free (valid);
return end;

View File

@ -803,7 +803,6 @@ reconfigure_folder_reconfigure(struct _mail_msg *mm)
char *fromurl = NULL, *tourl = NULL;
CamelFolder *fromfolder = NULL, *tofolder = NULL;
GPtrArray *uids;
int i;
char *metapath;
char *tmpname;
CamelURL *url = NULL;

View File

@ -371,9 +371,9 @@ vfolder_edit(void)
{
GtkWidget *w;
w = vfolder_editor_new(context);
gtk_signal_connect((GtkObject *)w, "clicked", vfolder_editor_clicked, NULL);
gtk_widget_show(w);
w = GTK_WIDGET (vfolder_editor_new (context));
gtk_signal_connect (GTK_OBJECT (w), "clicked", vfolder_editor_clicked, NULL);
gtk_widget_show (w);
}
static void