NeoMutt  2024-10-02-7-gd3e66a
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
Connection Account API

Function to get some login credentials. More...

Functions

static const char * imap_get_field (enum ConnAccountField field, void *gf_data)
 Get connection login credentials - Implements ConnAccount::get_field() -.
 
static const char * nntp_get_field (enum ConnAccountField field, void *gf_data)
 Get connection login credentials - Implements ConnAccount::get_field() -.
 
const char * pop_get_field (enum ConnAccountField field, void *gf_data)
 Get connection login credentials - Implements ConnAccount::get_field() -.
 
static const char * smtp_get_field (enum ConnAccountField field, void *gf_data)
 Get connection login credentials - Implements ConnAccount::get_field() -.
 

Detailed Description

Function to get some login credentials.

Parameters
fieldField to get, e.g. MUTT_CA_PASS
Return values
ptrRequested string

Function Documentation

◆ imap_get_field()

static const char * imap_get_field ( enum ConnAccountField  field,
void *  gf_data 
)
static

Get connection login credentials - Implements ConnAccount::get_field() -.

Definition at line 208 of file util.c.

209{
210 switch (field)
211 {
212 case MUTT_CA_LOGIN:
213 return cs_subset_string(NeoMutt->sub, "imap_login");
214 case MUTT_CA_USER:
215 return cs_subset_string(NeoMutt->sub, "imap_user");
216 case MUTT_CA_PASS:
217 return cs_subset_string(NeoMutt->sub, "imap_pass");
219 return cs_subset_string(NeoMutt->sub, "imap_oauth_refresh_command");
220 case MUTT_CA_HOST:
221 default:
222 return NULL;
223 }
224}
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:291
@ MUTT_CA_OAUTH_CMD
OAuth refresh command.
Definition: connaccount.h:38
@ MUTT_CA_USER
User name.
Definition: connaccount.h:36
@ MUTT_CA_LOGIN
Login name.
Definition: connaccount.h:35
@ MUTT_CA_HOST
Server name.
Definition: connaccount.h:34
@ MUTT_CA_PASS
Password.
Definition: connaccount.h:37
Container for Accounts, Notifications.
Definition: neomutt.h:42
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nntp_get_field()

static const char * nntp_get_field ( enum ConnAccountField  field,
void *  gf_data 
)
static

Get connection login credentials - Implements ConnAccount::get_field() -.

Definition at line 1032 of file newsrc.c.

1033{
1034 switch (field)
1035 {
1036 case MUTT_CA_LOGIN:
1037 case MUTT_CA_USER:
1038 return cs_subset_string(NeoMutt->sub, "nntp_user");
1039 case MUTT_CA_PASS:
1040 return cs_subset_string(NeoMutt->sub, "nntp_pass");
1041 case MUTT_CA_OAUTH_CMD:
1042 case MUTT_CA_HOST:
1043 default:
1044 return NULL;
1045 }
1046}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pop_get_field()

const char * pop_get_field ( enum ConnAccountField  field,
void *  gf_data 
)

Get connection login credentials - Implements ConnAccount::get_field() -.

Definition at line 57 of file lib.c.

58{
59 switch (field)
60 {
61 case MUTT_CA_LOGIN:
62 case MUTT_CA_USER:
63 return cs_subset_string(NeoMutt->sub, "pop_user");
64 case MUTT_CA_PASS:
65 return cs_subset_string(NeoMutt->sub, "pop_pass");
67 return cs_subset_string(NeoMutt->sub, "pop_oauth_refresh_command");
68 case MUTT_CA_HOST:
69 default:
70 return NULL;
71 }
72}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ smtp_get_field()

static const char * smtp_get_field ( enum ConnAccountField  field,
void *  gf_data 
)
static

Get connection login credentials - Implements ConnAccount::get_field() -.

Definition at line 322 of file smtp.c.

323{
324 struct SmtpAccountData *adata = gf_data;
325 if (!adata)
326 return NULL;
327
328 switch (field)
329 {
330 case MUTT_CA_LOGIN:
331 case MUTT_CA_USER:
332 {
333 const char *const c_smtp_user = cs_subset_string(adata->sub, "smtp_user");
334 return c_smtp_user;
335 }
336 case MUTT_CA_PASS:
337 {
338 const char *const c_smtp_pass = cs_subset_string(adata->sub, "smtp_pass");
339 return c_smtp_pass;
340 }
342 {
343 const char *const c_smtp_oauth_refresh_command = cs_subset_string(adata->sub, "smtp_oauth_refresh_command");
344 return c_smtp_oauth_refresh_command;
345 }
346 case MUTT_CA_HOST:
347 default:
348 return NULL;
349 }
350}
Server connection data.
Definition: smtp.c:97
struct ConfigSubset * sub
Config scope.
Definition: smtp.c:101
+ Here is the call graph for this function:
+ Here is the caller graph for this function: