NeoMutt  2024-02-01-23-g345d7b
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 205 of file util.c.

206{
207 switch (field)
208 {
209 case MUTT_CA_LOGIN:
210 return cs_subset_string(NeoMutt->sub, "imap_login");
211 case MUTT_CA_USER:
212 return cs_subset_string(NeoMutt->sub, "imap_user");
213 case MUTT_CA_PASS:
214 return cs_subset_string(NeoMutt->sub, "imap_pass");
216 return cs_subset_string(NeoMutt->sub, "imap_oauth_refresh_command");
217 case MUTT_CA_HOST:
218 default:
219 return NULL;
220 }
221}
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:292
@ 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:41
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:45
+ 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 994 of file newsrc.c.

995{
996 switch (field)
997 {
998 case MUTT_CA_LOGIN:
999 case MUTT_CA_USER:
1000 return cs_subset_string(NeoMutt->sub, "nntp_user");
1001 case MUTT_CA_PASS:
1002 return cs_subset_string(NeoMutt->sub, "nntp_pass");
1003 case MUTT_CA_OAUTH_CMD:
1004 case MUTT_CA_HOST:
1005 default:
1006 return NULL;
1007 }
1008}
+ 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:99
struct ConfigSubset * sub
Config scope.
Definition: smtp.c:103
+ Here is the call graph for this function:
+ Here is the caller graph for this function: