NeoMutt  2025-12-11-911-gd8d604
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
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() -.
 
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() -.
 
bool maildir_ac_owns_path (struct Account *a, const char *path)
 Check whether an Account owns a Mailbox path - Implements MxOps::ac_owns_path() -.
 
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() -.
 
static bool mh_ac_owns_path (struct Account *a, const char *path)
 Check whether an Account owns a Mailbox path - Implements MxOps::ac_owns_path() -.
 
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() -.
 
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() -.
 
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() -.
 

Detailed Description

Check whether an Account owns a Mailbox path.

Parameters
aAccount
pathMailbox Path
Return values
trueAccount handles path
falseAccount does not handle path
Precondition
a is not NULL
path is not NULL

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 397 of file compress.c.

398{
399 return false;
400}

◆ 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 1906 of file imap.c.

1907{
1908 struct Url *url = url_parse(path);
1909 if (!url)
1910 return false;
1911
1912 struct ImapAccountData *adata = a->adata;
1913 struct ConnAccount *cac = &adata->conn->account;
1914
1915 const bool rc = mutt_istr_equal(url->host, cac->host) &&
1916 (!url->user || mutt_istr_equal(url->user, cac->user));
1917 url_free(&url);
1918 return rc;
1919}
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
Definition string.c:677
void * adata
Private data (for Mailbox backends)
Definition account.h:42
Login details for a remote server.
Definition connaccount.h:59
char user[128]
Username.
Definition connaccount.h:62
char host[128]
Server to login to.
Definition connaccount.h:60
struct ConnAccount account
Account details: username, password, etc.
Definition connection.h:49
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:242
void url_free(struct Url **ptr)
Free the contents of a URL.
Definition url.c:124
+ 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 owns a Mailbox path - Implements MxOps::ac_owns_path() -.

Definition at line 45 of file account.c.

46{
47 return true;
48}

◆ 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 802 of file mbox.c.

803{
804 if ((a->type != MUTT_MBOX) && (a->type != MUTT_MMDF))
805 return false;
806
807 struct Mailbox **mp = ARRAY_FIRST(&a->mailboxes);
808 if (!mp)
809 return false;
810
811 return mutt_str_equal(mailbox_path(*mp), path);
812}
#define ARRAY_FIRST(head)
Convenience method to get the first element.
Definition array.h:136
static const char * mailbox_path(const struct Mailbox *m)
Get the Mailbox's path string.
Definition mailbox.h:216
@ MUTT_MMDF
'mmdf' Mailbox type
Definition mailbox.h:45
@ MUTT_MBOX
'mbox' Mailbox type
Definition mailbox.h:44
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition string.c:665
enum MailboxType type
Type of Mailboxes this Account contains.
Definition account.h:37
struct MailboxArray mailboxes
All Mailboxes.
Definition account.h:40
A mailbox.
Definition mailbox.h:81
+ Here is the call graph for this function:

◆ mh_ac_owns_path()

static bool mh_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 803 of file mh.c.

804{
805 return true;
806}

◆ 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 2367 of file nntp.c.

2368{
2369 return true;
2370}

◆ 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 2083 of file notmuch.c.

2084{
2085 return true;
2086}

◆ 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 706 of file pop.c.

707{
708 struct Url *url = url_parse(path);
709 if (!url)
710 return false;
711
712 struct PopAccountData *adata = a->adata;
713 struct ConnAccount *cac = &adata->conn->account;
714
715 const bool rc = mutt_istr_equal(url->host, cac->host) &&
716 mutt_istr_equal(url->user, cac->user);
717 url_free(&url);
718 return rc;
719}
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: