NeoMutt  2024-04-25-89-g194907
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
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 -.
 
static int op_generic_select_entry (struct SmimeData *sd, int op)
 Select the current entry - Implements smime_function_t -.
 

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 44 of file smime_functions.c.

45{
46 sd->done = true;
47 return FR_SUCCESS;
48}
@ 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 53 of file smime_functions.c.

54{
55 const int index = menu_get_index(sd->menu);
56 struct SmimeKey *cur_key = sd->table[index];
57 if (cur_key->trust != 't')
58 {
59 const char *s = "";
60 switch (cur_key->trust)
61 {
62 case 'e':
63 case 'i':
64 case 'r':
65 s = _("ID is expired/disabled/revoked. Do you really want to use the key?");
66 break;
67 case 'u':
68 s = _("ID has undefined validity. Do you really want to use the key?");
69 break;
70 case 'v':
71 s = _("ID is not trusted. Do you really want to use the key?");
72 break;
73 }
74
75 char buf[1024] = { 0 };
76 snprintf(buf, sizeof(buf), "%s", s);
77
78 if (query_yesorno(buf, MUTT_NO) != MUTT_YES)
79 {
81 return FR_NO_ACTION;
82 }
83 }
84
85 sd->key = cur_key;
86 sd->done = true;
87 return FR_SUCCESS;
88}
@ 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:160
#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 query_yesorno(const char *prompt, enum QuadOption def)
Ask the user a Yes/No question.
Definition: question.c:326
struct SmimeKey * key
Selected Key.
struct Menu * menu
Smime Menu.
struct SmimeKey ** table
Array of Keys.
An SIME key.
Definition: smime.h:43
char trust
i=Invalid r=revoked e=expired u=unverified v=verified t=trusted
Definition: smime.h:48
+ Here is the call graph for this function: