[Commits] [SCM] claws branch, master, updated. 3.11.1-5-g420e834

claws at claws-mail.org claws at claws-mail.org
Thu Oct 30 19:21:30 CET 2014


The branch, master has been updated
       via  420e8349978b7c927a80f1a5dd63fd737526feed (commit)
      from  5800b5c77fd0bc8a26f1958635281c9fbd852e42 (commit)

Summary of changes:
 src/plugins/pgpcore/sgpgme.c |   37 ++++++++++++++++++++++++++++---------
 1 file changed, 28 insertions(+), 9 deletions(-)


- Log -----------------------------------------------------------------
commit 420e8349978b7c927a80f1a5dd63fd737526feed
Author: Paul <paul at claws-mail.org>
Date:   Thu Oct 30 18:21:13 2014 +0000

    implement RFE 3314, 'user can't see validity of gpg signatures' [SIC]
    
    also a little reformatting of similar strings

diff --git a/src/plugins/pgpcore/sgpgme.c b/src/plugins/pgpcore/sgpgme.c
index 3de07e2..6662878 100644
--- a/src/plugins/pgpcore/sgpgme.c
+++ b/src/plugins/pgpcore/sgpgme.c
@@ -190,6 +190,7 @@ static gchar *extract_name(const char *uid)
 gchar *sgpgme_sigstat_info_short(gpgme_ctx_t ctx, gpgme_verify_result_t status)
 {
 	gpgme_signature_t sig = NULL;
+	gpgme_user_id_t user = NULL;
 	gchar *uname = NULL;
 	gpgme_key_t key;
 	gchar *result = NULL;
@@ -219,34 +220,52 @@ gchar *sgpgme_sigstat_info_short(gpgme_ctx_t ctx, gpgme_verify_result_t status)
 		return g_strdup_printf(_("The signature can't be checked - %s"), 
 			gpgme_strerror(err));
 	}
-	if (key)
+	if (key) {
+		user = key->uids;
 		uname = extract_name(key->uids->uid);
-	else
+	} else
 		uname = g_strdup("<?>");
+
 	switch (gpg_err_code(sig->status)) {
 	case GPG_ERR_NO_ERROR:
-		result = g_strdup_printf(_("Good signature from %s."), uname);
+               switch (user->validity) {
+		case GPGME_VALIDITY_ULTIMATE:
+			result = g_strdup_printf(_("Good signature from \"%s\" [ultimate]"), uname);
+			break;
+		case GPGME_VALIDITY_FULL:
+			result = g_strdup_printf(_("Good signature from \"%s\" [full]"), uname);
+			break;
+		case GPGME_VALIDITY_MARGINAL:
+			result = g_strdup_printf(_("Good signature from \"%s\" [marginal]"), uname);
+			break;
+		case GPGME_VALIDITY_UNKNOWN:
+		case GPGME_VALIDITY_UNDEFINED:
+		case GPGME_VALIDITY_NEVER:
+		default:
+			result = g_strdup_printf(_("Good signature from \"%s\""), uname);
+			break;
+               }
 		break;
 	case GPG_ERR_SIG_EXPIRED:
-		result = g_strdup_printf(_("Expired signature from %s."), uname);
+		result = g_strdup_printf(_("Expired signature from \"%s\""), uname);
 		break;
 	case GPG_ERR_KEY_EXPIRED:
-		result = g_strdup_printf(_("Good signature from %s, but the key has expired."), uname);
+		result = g_strdup_printf(_("Good signature from \"%s\", but the key has expired"), uname);
 		break;
 	case GPG_ERR_CERT_REVOKED:
-		result = g_strdup_printf(_("Good signature from %s, but the key has been revoked."), uname);
+		result = g_strdup_printf(_("Good signature from \"%s\", but the key has been revoked"), uname);
 		break;
 	case GPG_ERR_BAD_SIGNATURE:
-		result = g_strdup_printf(_("Bad signature from %s."), uname);
+		result = g_strdup_printf(_("Bad signature from \"%s\""), uname);
 		break;
 	case GPG_ERR_NO_PUBKEY: {
 		gchar *id = g_strdup(sig->fpr + strlen(sig->fpr)-8);
-		result = g_strdup_printf(_("Key 0x%s not available to verify this signature."), id);
+		result = g_strdup_printf(_("Key 0x%s not available to verify this signature"), id);
 		g_free(id);
 		break;
 		}
 	default:
-		result = g_strdup(_("The signature has not been checked."));
+		result = g_strdup(_("The signature has not been checked"));
 		break;
 	}
 	if (result == NULL)

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list