NeoMutt  2024-12-12-14-g7b49f7
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
functions.c File Reference

Autocrypt functions. More...

#include "config.h"
#include <stdbool.h>
#include <stdio.h>
#include "private.h"
#include "mutt/lib.h"
#include "address/lib.h"
#include "config/lib.h"
#include "core/lib.h"
#include "gui/lib.h"
#include "lib.h"
#include "key/lib.h"
#include "menu/lib.h"
#include "question/lib.h"
#include "autocrypt_data.h"
#include "functions.h"
+ Include dependency graph for functions.c:

Go to the source code of this file.

Functions

static void toggle_active (struct AccountEntry *entry)
 Toggle whether an Autocrypt account is active.
 
static void toggle_prefer_encrypt (struct AccountEntry *entry)
 Toggle whether an Autocrypt account prefers encryption.
 
static int op_autocrypt_create_acct (struct AutocryptData *ad, int op)
 Create a new autocrypt account - Implements autocrypt_function_t -.
 
static int op_autocrypt_delete_acct (struct AutocryptData *ad, int op)
 Delete the current account - Implements autocrypt_function_t -.
 
static int op_autocrypt_toggle_active (struct AutocryptData *ad, int op)
 Toggle the current account active/inactive - Implements autocrypt_function_t -.
 
static int op_autocrypt_toggle_prefer (struct AutocryptData *ad, int op)
 Toggle the current account prefer-encrypt flag - Implements autocrypt_function_t -.
 
static int op_exit (struct AutocryptData *ad, int op)
 Exit this menu - Implements autocrypt_function_t -.
 
int autocrypt_function_dispatcher (struct MuttWindow *win, int op)
 Perform a Autocrypt function - Implements function_dispatcher_t -.
 

Variables

const struct MenuFuncOp OpAutocrypt []
 Functions for the Autocrypt Account.
 
const struct MenuOpSeq AutocryptDefaultBindings []
 Key bindings for the Autocrypt Account.
 
static const struct AutocryptFunction AutocryptFunctions []
 All the NeoMutt functions that the Autocrypt supports.
 

Detailed Description

Autocrypt functions.

Authors
  • Richard Russon

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file functions.c.

Function Documentation

◆ toggle_active()

static void toggle_active ( struct AccountEntry entry)
static

Toggle whether an Autocrypt account is active.

Parameters
entryMenu Entry for the account

Definition at line 83 of file functions.c.

84{
85 entry->account->enabled = !entry->account->enabled;
87 {
88 entry->account->enabled = !entry->account->enabled;
89 /* L10N: This error message is displayed if a database update of an
90 account record fails for some odd reason. */
91 mutt_error(_("Error updating account record"));
92 }
93}
int mutt_autocrypt_db_account_update(struct AutocryptAccount *acct)
Update Account info in the Autocrypt database.
Definition: db.c:381
#define mutt_error(...)
Definition: logging2.h:92
#define _(a)
Definition: message.h:28
struct AutocryptAccount * account
Account details.
Definition: private.h:48
bool enabled
Is this account enabled.
Definition: lib.h:115
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toggle_prefer_encrypt()

static void toggle_prefer_encrypt ( struct AccountEntry entry)
static

Toggle whether an Autocrypt account prefers encryption.

Parameters
entryMenu Entry for the account

Definition at line 99 of file functions.c.

100{
101 entry->account->prefer_encrypt = !entry->account->prefer_encrypt;
103 {
104 entry->account->prefer_encrypt = !entry->account->prefer_encrypt;
105 mutt_error(_("Error updating account record"));
106 }
107}
bool prefer_encrypt
false = nopref, true = mutual
Definition: lib.h:114
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ OpAutocrypt

const struct MenuFuncOp OpAutocrypt[]
Initial value:
= {
{ "create-account", OP_AUTOCRYPT_CREATE_ACCT },
{ "delete-account", OP_AUTOCRYPT_DELETE_ACCT },
{ "exit", OP_EXIT },
{ "toggle-active", OP_AUTOCRYPT_TOGGLE_ACTIVE },
{ "toggle-prefer-encrypt", OP_AUTOCRYPT_TOGGLE_PREFER },
{ NULL, 0 }
}

Functions for the Autocrypt Account.

Definition at line 54 of file functions.c.

◆ AutocryptDefaultBindings

const struct MenuOpSeq AutocryptDefaultBindings[]
Initial value:
= {
{ OP_AUTOCRYPT_CREATE_ACCT, "c" },
{ OP_AUTOCRYPT_DELETE_ACCT, "D" },
{ OP_AUTOCRYPT_TOGGLE_ACTIVE, "a" },
{ OP_AUTOCRYPT_TOGGLE_PREFER, "p" },
{ OP_EXIT, "q" },
{ 0, NULL }
}

Key bindings for the Autocrypt Account.

Definition at line 68 of file functions.c.

◆ AutocryptFunctions

const struct AutocryptFunction AutocryptFunctions[]
static
Initial value:
= {
{ OP_AUTOCRYPT_CREATE_ACCT, op_autocrypt_create_acct },
{ OP_AUTOCRYPT_DELETE_ACCT, op_autocrypt_delete_acct },
{ OP_AUTOCRYPT_TOGGLE_ACTIVE, op_autocrypt_toggle_active },
{ OP_AUTOCRYPT_TOGGLE_PREFER, op_autocrypt_toggle_prefer },
{ OP_EXIT, op_exit },
{ 0, NULL },
}
static int op_exit(struct AliasMenuData *mdata, int op)
exit this menu - Implements alias_function_t -
Definition: functions.c:201
static int op_autocrypt_toggle_prefer(struct AutocryptData *ad, int op)
Toggle the current account prefer-encrypt flag - Implements autocrypt_function_t -.
Definition: functions.c:170
static int op_autocrypt_delete_acct(struct AutocryptData *ad, int op)
Delete the current account - Implements autocrypt_function_t -.
Definition: functions.c:125
static int op_autocrypt_toggle_active(struct AutocryptData *ad, int op)
Toggle the current account active/inactive - Implements autocrypt_function_t -.
Definition: functions.c:151
static int op_autocrypt_create_acct(struct AutocryptData *ad, int op)
Create a new autocrypt account - Implements autocrypt_function_t -.
Definition: functions.c:114

All the NeoMutt functions that the Autocrypt supports.

Definition at line 200 of file functions.c.