NeoMutt  2022-04-29-178-g3b62e6
Teaching an old dog new tricks
DOXYGEN
ac_owns_path()

Check whether an Account owns a Mailbox path. More...

+ Collaboration diagram for ac_owns_path():

Functions

static bool comp_ac_owns_path (struct Account *a, const char *path)
 Check whether an Account owns a Mailbox path - Implements MxOps::ac_owns_path() -. More...
 
static bool imap_ac_owns_path (struct Account *a, const char *path)
 Check whether an Account owns a Mailbox path - Implements MxOps::ac_owns_path() -. More...
 
bool maildir_ac_owns_path (struct Account *a, const char *path)
 Check whether an Account own a Mailbox path - Implements MxOps::ac_owns_path() -. More...
 
bool mh_ac_owns_path (struct Account *a, const char *path)
 Check whether an Account own a Mailbox path - Implements MxOps::ac_owns_path() -. More...
 
static bool mbox_ac_owns_path (struct Account *a, const char *path)
 Check whether an Account owns a Mailbox path - Implements MxOps::ac_owns_path() -. More...
 
static bool nntp_ac_owns_path (struct Account *a, const char *path)
 Check whether an Account owns a Mailbox path - Implements MxOps::ac_owns_path() -. More...
 
static bool nm_ac_owns_path (struct Account *a, const char *path)
 Check whether an Account owns a Mailbox path - Implements MxOps::ac_owns_path() -. More...
 
static bool pop_ac_owns_path (struct Account *a, const char *path)
 Check whether an Account owns a Mailbox path - Implements MxOps::ac_owns_path() -. More...
 

Detailed Description

Check whether an Account owns a Mailbox path.

Parameters
aAccount
pathMailbox Path
Return values
trueAccount handles path
falseAccount does not handle path

Contract

Function Documentation

◆ comp_ac_owns_path()

static bool comp_ac_owns_path ( struct Account a,
const char *  path 
)
static

Check whether an Account owns a Mailbox path - Implements MxOps::ac_owns_path() -.

Definition at line 422 of file compress.c.

423{
424 return false;
425}

◆ imap_ac_owns_path()

static bool imap_ac_owns_path ( struct Account a,
const char *  path 
)
static

Check whether an Account owns a Mailbox path - Implements MxOps::ac_owns_path() -.

Definition at line 1743 of file imap.c.

1744{
1745 struct Url *url = url_parse(path);
1746 if (!url)
1747 return false;
1748
1749 struct ImapAccountData *adata = a->adata;
1750 struct ConnAccount *cac = &adata->conn->account;
1751
1752 const bool rc = mutt_istr_equal(url->host, cac->host) &&
1753 (!url->user || mutt_istr_equal(url->user, cac->user));
1754 url_free(&url);
1755 return rc;
1756}
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
Definition: string.c:796
void * adata
Private data (for Mailbox backends)
Definition: account.h:43
Login details for a remote server.
Definition: connaccount.h:53
char user[128]
Username.
Definition: connaccount.h:56
char host[128]
Server to login to.
Definition: connaccount.h:54
struct ConnAccount account
Account details: username, password, etc.
Definition: connection.h:50
IMAP-specific Account data -.
Definition: adata.h:40
struct Connection * conn
Connection to IMAP server.
Definition: adata.h:41
A parsed URL proto://user:password@host:port/path?a=1&b=2
Definition: url.h:69
char * user
Username.
Definition: url.h:71
char * host
Host.
Definition: url.h:73
char * path
Path.
Definition: url.h:75
struct Url * url_parse(const char *src)
Fill in Url.
Definition: url.c:234
void url_free(struct Url **ptr)
Free the contents of a URL.
Definition: url.c:123
+ Here is the call graph for this function:

◆ maildir_ac_owns_path()

bool maildir_ac_owns_path ( struct Account a,
const char *  path 
)

Check whether an Account own a Mailbox path - Implements MxOps::ac_owns_path() -.

Definition at line 1078 of file maildir.c.

1079{
1080 return true;
1081}

◆ mh_ac_owns_path()

bool mh_ac_owns_path ( struct Account a,
const char *  path 
)

Check whether an Account own a Mailbox path - Implements MxOps::ac_owns_path() -.

Definition at line 833 of file mh.c.

834{
835 return true;
836}

◆ mbox_ac_owns_path()

static bool mbox_ac_owns_path ( struct Account a,
const char *  path 
)
static

Check whether an Account owns a Mailbox path - Implements MxOps::ac_owns_path() -.

Definition at line 877 of file mbox.c.

878{
879 if ((a->type != MUTT_MBOX) && (a->type != MUTT_MMDF))
880 return false;
881
882 struct MailboxNode *np = STAILQ_FIRST(&a->mailboxes);
883 if (!np)
884 return false;
885
886 return mutt_str_equal(mailbox_path(np->mailbox), path);
887}
static const char * mailbox_path(const struct Mailbox *m)
Get the Mailbox's path string.
Definition: mailbox.h:211
@ MUTT_MMDF
'mmdf' Mailbox type
Definition: mailbox.h:46
@ MUTT_MBOX
'mbox' Mailbox type
Definition: mailbox.h:45
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:784
#define STAILQ_FIRST(head)
Definition: queue.h:350
enum MailboxType type
Type of Mailboxes this Account contains.
Definition: account.h:38
struct MailboxList mailboxes
List of Mailboxes.
Definition: account.h:41
List of Mailboxes.
Definition: mailbox.h:154
struct Mailbox * mailbox
Mailbox in the list.
Definition: mailbox.h:155
+ Here is the call graph for this function:

◆ nntp_ac_owns_path()

static bool nntp_ac_owns_path ( struct Account a,
const char *  path 
)
static

Check whether an Account owns a Mailbox path - Implements MxOps::ac_owns_path() -.

Definition at line 2284 of file nntp.c.

2285{
2286 return true;
2287}

◆ nm_ac_owns_path()

static bool nm_ac_owns_path ( struct Account a,
const char *  path 
)
static

Check whether an Account owns a Mailbox path - Implements MxOps::ac_owns_path() -.

Definition at line 1994 of file notmuch.c.

1995{
1996 return true;
1997}

◆ pop_ac_owns_path()

static bool pop_ac_owns_path ( struct Account a,
const char *  path 
)
static

Check whether an Account owns a Mailbox path - Implements MxOps::ac_owns_path() -.

Definition at line 693 of file pop.c.

694{
695 struct Url *url = url_parse(path);
696 if (!url)
697 return false;
698
699 struct PopAccountData *adata = a->adata;
700 struct ConnAccount *cac = &adata->conn->account;
701
702 const bool rc = mutt_istr_equal(url->host, cac->host) &&
703 mutt_istr_equal(url->user, cac->user);
704 url_free(&url);
705 return rc;
706}
POP-specific Account data -.
Definition: adata.h:37
struct Connection * conn
Connection to POP server.
Definition: adata.h:38
+ Here is the call graph for this function: