NeoMutt  2025-12-11-911-gd8d604
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
module.c
Go to the documentation of this file.
1
22
28
29#include "config.h"
30#include <stdbool.h>
31#include <stddef.h>
32#include "mutt/lib.h"
33#include "config/lib.h"
34#include "core/lib.h"
35#ifdef USE_AUTOCRYPT
36#include "lib.h"
37#endif
38#include "module_data.h"
39
40extern struct ConfigDef AutocryptVars[];
41
45static bool autocrypt_init(struct NeoMutt *n)
46{
47 struct AutocryptModuleData *mod_data = MUTT_MEM_CALLOC(1, struct AutocryptModuleData);
49
50 mod_data->notify = notify_new();
51 notify_set_parent(mod_data->notify, n->notify);
52
53 return true;
54}
55
59static bool autocrypt_config_define_variables(struct NeoMutt *n, struct ConfigSet *cs)
60{
61 bool rc = false;
62
63#if defined(USE_AUTOCRYPT)
65#endif
66
67 return rc;
68}
69
73static bool autocrypt_cleanup(struct NeoMutt *n, void *data)
74{
75 struct AutocryptModuleData *mod_data = data;
76
77 notify_free(&mod_data->notify);
78
79 mutt_autocrypt_cleanup(mod_data);
80
81 FREE(&mod_data->autocrypt_sign_as);
82 FREE(&mod_data->autocrypt_default_key);
83
84 FREE(&mod_data);
85 return true;
86}
87
91const struct Module ModuleAutocrypt = {
93 "autocrypt",
95 NULL, // config_define_types
97 NULL, // commands_register
98 NULL, // gui_init
99 NULL, // gui_cleanup
101};
struct ConfigDef AutocryptVars[]
Config definitions for the autocrypt library.
Definition config.c:59
Autocrypt end-to-end encryption.
static bool autocrypt_config_define_variables(struct NeoMutt *n, struct ConfigSet *cs)
Define the Config Variables - Implements Module::config_define_variables()
Definition module.c:59
static bool autocrypt_init(struct NeoMutt *n)
Initialise a Module - Implements Module::init()
Definition module.c:45
static bool autocrypt_cleanup(struct NeoMutt *n, void *data)
Clean up a Module - Implements Module::cleanup()
Definition module.c:73
const struct Module ModuleAutocrypt
Module for the Autocrypt library.
Definition module.c:91
Autocrypt private Module data.
void mutt_autocrypt_cleanup(struct AutocryptModuleData *mod_data)
Shutdown Autocrypt.
Definition autocrypt.c:136
Convenience wrapper for the config headers.
bool cs_register_variables(const struct ConfigSet *cs, struct ConfigDef vars[])
Register a set of config items.
Definition set.c:290
Convenience wrapper for the core headers.
#define FREE(x)
Free memory and set the pointer to NULL.
Definition memory.h:68
#define MUTT_MEM_CALLOC(n, type)
Definition memory.h:52
@ MODULE_ID_AUTOCRYPT
ModuleAutocrypt, Autocrypt
Definition module_api.h:50
Convenience wrapper for the library headers.
struct Notify * notify_new(void)
Create a new notifications handler.
Definition notify.c:62
void notify_set_parent(struct Notify *notify, struct Notify *parent)
Set the parent notification handler.
Definition notify.c:95
void notify_free(struct Notify **ptr)
Free a notification handler.
Definition notify.c:75
void neomutt_set_module_data(struct NeoMutt *n, enum ModuleId id, void *data)
Set the private data for a Module.
Definition neomutt.c:677
Autocrypt private Module data.
Definition module_data.h:32
char * autocrypt_sign_as
Autocrypt Key id to sign as.
Definition module_data.h:36
char * autocrypt_default_key
Autocrypt default key id (used for postponing messages)
Definition module_data.h:35
struct Notify * notify
Notifications.
Definition module_data.h:33
Container for lots of config items.
Definition set.h:251
Container for Accounts, Notifications.
Definition neomutt.h:41
struct Notify * notify
Notifications handler.
Definition neomutt.h:45