NeoMutt  2024-12-12-14-g7b49f7
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 207 of file util.c.

208{
209 switch (field)
210 {
211 case MUTT_CA_LOGIN:
212 return cs_subset_string(NeoMutt->sub, "imap_login");
213 case MUTT_CA_USER:
214 return cs_subset_string(NeoMutt->sub, "imap_user");
215 case MUTT_CA_PASS:
216 return cs_subset_string(NeoMutt->sub, "imap_pass");
218 return cs_subset_string(NeoMutt->sub, "imap_oauth_refresh_command");
219 case MUTT_CA_HOST:
220 default:
221 return NULL;
222 }
223}
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 914 of file newsrc.c.

915{
916 switch (field)
917 {
918 case MUTT_CA_LOGIN:
919 case MUTT_CA_USER:
920 return cs_subset_string(NeoMutt->sub, "nntp_user");
921 case MUTT_CA_PASS:
922 return cs_subset_string(NeoMutt->sub, "nntp_pass");
924 case MUTT_CA_HOST:
925 default:
926 return NULL;
927 }
928}
+ 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 321 of file smtp.c.

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