From 83dc7625983470bff4ce8b9070fbc23c3370c472 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 23 Dec 2009 19:31:47 +0100 Subject: Bug #520816 - S/MIME shares "Do not sign meeting requests" with PGP --- composer/e-msg-composer.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'composer') diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 2f2bb99baa..6477936011 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -1460,7 +1460,7 @@ msg_composer_account_changed_cb (EMsgComposer *composer) GtkToggleAction *action; ESignature *signature; EAccount *account; - gboolean active; + gboolean active, can_sign; const gchar *uid; table = e_msg_composer_get_header_table (composer); @@ -1469,14 +1469,15 @@ msg_composer_account_changed_cb (EMsgComposer *composer) if (account == NULL) goto exit; - action = GTK_TOGGLE_ACTION (ACTION (PGP_SIGN)); - active = account->pgp_always_sign && - (!account->pgp_no_imip_sign || p->mime_type == NULL || + can_sign = (!account->pgp_no_imip_sign || p->mime_type == NULL || g_ascii_strncasecmp (p->mime_type, "text/calendar", 13) != 0); + + action = GTK_TOGGLE_ACTION (ACTION (PGP_SIGN)); + active = account->pgp_always_sign && can_sign; gtk_toggle_action_set_active (action, active); action = GTK_TOGGLE_ACTION (ACTION (SMIME_SIGN)); - active = account->smime_sign_default; + active = account->smime_sign_default && can_sign; gtk_toggle_action_set_active (action, active); action = GTK_TOGGLE_ACTION (ACTION (SMIME_ENCRYPT)); @@ -3370,6 +3371,9 @@ e_msg_composer_set_body (EMsgComposer *composer, action = GTK_TOGGLE_ACTION (ACTION (PGP_SIGN)); gtk_toggle_action_set_active (action, FALSE); + + action = GTK_TOGGLE_ACTION (ACTION (SMIME_SIGN)); + gtk_toggle_action_set_active (action, FALSE); } } } -- cgit