#include "sort.h"
/* These Config Variables are only used in hdrline.c */
+struct MbTable *CryptoChars; ///< Config: User-configurable crypto flags: signed, encrypted etc.
struct MbTable *FlagChars; ///< Config: User-configurable index flags: tagged, new, etc
struct MbTable *FromChars; ///< Config: User-configurable index flags: to address, cc address, etc
struct MbTable *ToChars; ///< Config: Indicator characters for the 'To' field in the index
FLAG_CHAR_ZEMPTY, ///< Character denoting a read email, $index_format %Z expando
};
+/**
+ * enum CryptoChars - Index into the CryptoChars variable ($crypto_chars)
+ */
+enum CryptoChars
+{
+ FLAG_CHAR_CRYPTO_GOOD_SIGN, ///< Character denoting a message signed with a verified key
+ FLAG_CHAR_CRYPTO_ENCRYPTED, ///< Character denoting a message is PGP-encrypted
+ FLAG_CHAR_CRYPTO_SIGNED, ///< Character denoting a message is signed
+ FLAG_CHAR_CRYPTO_CONTAINS_KEY, ///< Character denoting a message contains a PGP key
+ FLAG_CHAR_CRYPTO_NO_CRYPTO, ///< Character denoting a message has no cryptography information
+};
+
/**
* mutt_is_mail_list - Is this the email address of a mailing list?
* @param addr Address to test
{
const char *ch = NULL;
if ((WithCrypto != 0) && (e->security & GOODSIGN))
- ch = "S";
+ ch = get_nth_wchar(CryptoChars, FLAG_CHAR_CRYPTO_GOOD_SIGN);
else if ((WithCrypto != 0) && (e->security & ENCRYPT))
- ch = "P";
+ ch = get_nth_wchar(CryptoChars, FLAG_CHAR_CRYPTO_ENCRYPTED);
else if ((WithCrypto != 0) && (e->security & SIGN))
- ch = "s";
+ ch = get_nth_wchar(CryptoChars, FLAG_CHAR_CRYPTO_SIGNED);
else if (((WithCrypto & APPLICATION_PGP) != 0) && ((e->security & PGP_KEY) == PGP_KEY))
{
- ch = "K";
+ ch = get_nth_wchar(CryptoChars, FLAG_CHAR_CRYPTO_CONTAINS_KEY);
}
else
- ch = " ";
+ ch = get_nth_wchar(CryptoChars, FLAG_CHAR_CRYPTO_NO_CRYPTO);
snprintf(tmp, sizeof(tmp), "%s", ch);
src++;
else if (e->attach_del)
second = get_nth_wchar(FlagChars, FLAG_CHAR_DELETED_ATTACH);
else if ((WithCrypto != 0) && (e->security & GOODSIGN))
- second = "S";
+ second = get_nth_wchar(CryptoChars, FLAG_CHAR_CRYPTO_GOOD_SIGN);
else if ((WithCrypto != 0) && (e->security & ENCRYPT))
- second = "P";
+ second = get_nth_wchar(CryptoChars, FLAG_CHAR_CRYPTO_ENCRYPTED);
else if ((WithCrypto != 0) && (e->security & SIGN))
- second = "s";
+ second = get_nth_wchar(CryptoChars, FLAG_CHAR_CRYPTO_SIGNED);
else if (((WithCrypto & APPLICATION_PGP) != 0) && (e->security & PGP_KEY))
- second = "K";
+ second = get_nth_wchar(CryptoChars, FLAG_CHAR_CRYPTO_CONTAINS_KEY);
else
- second = " ";
+ second = get_nth_wchar(CryptoChars, FLAG_CHAR_CRYPTO_NO_CRYPTO);
/* Tagged, flagged and recipient flag */
const char *third = NULL;
** .dt 11 .dd <space> .dd The mail is read - %Z expando.
** .de
*/
+ { "crypto_chars", DT_MBTABLE, R_BOTH, &CryptoChars, IP "SPsK " },
+ /*
+ ** .pp
+ ** Controls the characters used in cryptography flags.
+ ** .dl
+ ** .dt \fBCharacter\fP .dd \fBDefault\fP .dd \fBDescription\fP
+ ** .dt 1 .dd S .dd The mail is signed, and the signature is successfully verified.
+ ** .dt 2 .dd P .dd The mail is PGP encrypted.
+ ** .dt 3 .dd s .dd The mail is signed.
+ ** .dt 4 .dd K .dd The mail contains a PGP public key.
+ ** .dt 5 .dd <space> .dd The mail has no crypto info.
+ ** .de
+ */
{ "flag_safe", DT_BOOL, R_NONE, &FlagSafe, false },
/*
** .pp