NeoMutt  2025-12-11-694-ga89709
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:41
struct ConfigSubset * sub
Inherited config items.
Definition neomutt.h:49
+ 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 920 of file newsrc.c.

921{
922 switch (field)
923 {
924 case MUTT_CA_LOGIN:
925 case MUTT_CA_USER:
926 return cs_subset_string(NeoMutt->sub, "nntp_user");
927 case MUTT_CA_PASS:
928 return cs_subset_string(NeoMutt->sub, "nntp_pass");
930 case MUTT_CA_HOST:
931 default:
932 return NULL;
933 }
934}
+ 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 56 of file lib.c.

57{
58 switch (field)
59 {
60 case MUTT_CA_LOGIN:
61 case MUTT_CA_USER:
62 return cs_subset_string(NeoMutt->sub, "pop_user");
63 case MUTT_CA_PASS:
64 return cs_subset_string(NeoMutt->sub, "pop_pass");
66 return cs_subset_string(NeoMutt->sub, "pop_oauth_refresh_command");
67 case MUTT_CA_HOST:
68 default:
69 return NULL;
70 }
71}
+ 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: