Specialize alertpanel icons
[claws.git] / src / sgpgme.c
index 0b655643a0176a5e33269db0b8329fcba356b77c..7c9551032266f8c1a2ad26e3026c6df4bb76d223 100644 (file)
@@ -58,10 +58,19 @@ GpgmeSigStat sgpgme_verify_signature(GpgmeCtx ctx, GpgmeData sig,
        return status;
 }
 
-SignatureStatus sgpgme_sigstat_gpgme_to_privacy(GpgmeSigStat status)
+SignatureStatus sgpgme_sigstat_gpgme_to_privacy(GpgmeCtx ctx, GpgmeSigStat status)
 {
+       unsigned long validity = 0;
+       
+       validity = gpgme_get_sig_ulong_attr(ctx, 0,
+               GPGME_ATTR_VALIDITY, 0);
+
        switch (status) {
        case GPGME_SIG_STAT_GOOD:
+               if ((validity != GPGME_VALIDITY_MARGINAL) &&
+                   (validity != GPGME_VALIDITY_FULL) &&
+                   (validity != GPGME_VALIDITY_ULTIMATE))
+                       return SIGNATURE_WARN;
                return SIGNATURE_OK;
        case GPGME_SIG_STAT_GOOD_EXP:
        case GPGME_SIG_STAT_GOOD_EXPKEY:
@@ -205,7 +214,7 @@ gchar *sgpgme_sigstat_info_full(GpgmeCtx ctx, GpgmeSigStat status)
                                format = _("Signature expires %s\n");
                        else
                                format = _("Signature expired %s\n");
-                       g_string_sprintfa(siginfo, format, time);
+                       g_string_sprintfa(siginfo, format, timestr);
                }
                
                g_string_append(siginfo, "\n");
@@ -277,8 +286,9 @@ void sgpgme_init()
 
                        val = alertpanel_message_with_disable
                                (_("Warning"),
-                                _("GnuPG is not installed properly, or needs to be upgraded.\n"
-                                  "OpenPGP support disabled."));
+                                _("GnuPG is not installed properly, or needs "
+                                  "to be upgraded.\n"
+                                  "OpenPGP support disabled."), ALERT_WARNING);
                        if (val & G_ALERTDISABLE)
                                prefs_common.gpg_warning = FALSE;
                }