NeoMutt  2022-04-29-249-gaae397
Teaching an old dog new tricks
DOXYGEN
Smime Function API

Prototype for a Smime Function. More...

+ Collaboration diagram for Smime Function API:

Functions

static int op_exit (struct SmimeData *sd, int op)
 Exit this menu - Implements smime_function_t -. More...
 
static int op_generic_select_entry (struct SmimeData *sd, int op)
 Select the current entry - Implements smime_function_t -. More...
 

Detailed Description

Prototype for a Smime Function.

Parameters
menuMenu
opOperation to perform, e.g. OP_GENERIC_SELECT_ENTRY
Return values
enumFunctionRetval

Function Documentation

◆ op_exit()

static int op_exit ( struct SmimeData sd,
int  op 
)
static

Exit this menu - Implements smime_function_t -.

Definition at line 45 of file smime_functions.c.

46{
47 sd->done = true;
48 return FR_SUCCESS;
49}
@ FR_SUCCESS
Valid function - successfully performed.
Definition: dispatcher.h:39
bool done
Should we close the Dialog?

◆ op_generic_select_entry()

static int op_generic_select_entry ( struct SmimeData sd,
int  op 
)
static

Select the current entry - Implements smime_function_t -.

Definition at line 54 of file smime_functions.c.

55{
56 const int index = menu_get_index(sd->menu);
57 struct SmimeKey *cur_key = sd->table[index];
58 if (cur_key->trust != 't')
59 {
60 const char *s = "";
61 switch (cur_key->trust)
62 {
63 case 'e':
64 case 'i':
65 case 'r':
66 s = _("ID is expired/disabled/revoked. Do you really want to use the key?");
67 break;
68 case 'u':
69 s = _("ID has undefined validity. Do you really want to use the key?");
70 break;
71 case 'v':
72 s = _("ID is not trusted. Do you really want to use the key?");
73 break;
74 }
75
76 char buf[1024] = { 0 };
77 snprintf(buf, sizeof(buf), "%s", s);
78
79 if (mutt_yesorno(buf, MUTT_NO) != MUTT_YES)
80 {
82 return FR_NO_ACTION;
83 }
84 }
85
86 sd->key = cur_key;
87 sd->done = true;
88 return FR_SUCCESS;
89}
@ FR_NO_ACTION
Valid function - no action performed.
Definition: dispatcher.h:37
int menu_get_index(struct Menu *menu)
Get the current selection in the Menu.
Definition: menu.c:154
#define _(a)
Definition: message.h:28
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
Definition: mutt_logging.c:74
@ MUTT_NO
User answered 'No', or assume 'No'.
Definition: quad.h:38
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
Definition: quad.h:39
enum QuadOption mutt_yesorno(const char *msg, enum QuadOption def)
Ask the user a Yes/No question.
Definition: question.c:194
struct SmimeKey * key
Selected Key.
struct Menu * menu
Smime Menu.
struct SmimeKey ** table
Array of Keys.
An SIME key.
Definition: smime.h:44
char trust
i=Invalid r=revoked e=expired u=unverified v=verified t=trusted
Definition: smime.h:49
+ Here is the call graph for this function: