NeoMutt  2025-12-11-911-gd8d604
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
Address Predicate API

Prototype for an Address Test function. More...

Functions

bool mutt_is_mail_list (const struct Address *addr)
 Is this the email address of a mailing list?
 
bool mutt_is_subscribed_list (const struct Address *addr)
 Is this the email address of a user-subscribed mailing list?
 

Detailed Description

Prototype for an Address Test function.

Parameters
aAddress to test
Return values
trueAddress matches the test

Function Documentation

◆ mutt_is_mail_list()

bool mutt_is_mail_list ( const struct Address * addr)

Is this the email address of a mailing list?

Definition at line 46 of file maillist.c.

47{
49 ASSERT(mod_data);
50
51 if (!mutt_regexlist_match(&mod_data->unmail, buf_string(addr->mailbox)))
52 return mutt_regexlist_match(&mod_data->mail, buf_string(addr->mailbox));
53 return false;
54}
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition buffer.h:96
@ MODULE_ID_ALIAS
ModuleAlias, Alias
Definition module_api.h:48
bool mutt_regexlist_match(struct RegexList *rl, const char *str)
Does a string match any Regex in the list?
Definition regex.c:200
void * neomutt_get_module_data(struct NeoMutt *n, enum ModuleId id)
Get the private data for a Module.
Definition neomutt.c:663
#define ASSERT(COND)
Definition signal2.h:59
struct Buffer * mailbox
Mailbox and host address.
Definition address.h:37
Alias private Module data.
Definition module_data.h:33
struct RegexList mail
Regexes to match mailing lists.
Definition module_data.h:48
struct RegexList unmail
Regexes to exclude false matches in mail.
Definition module_data.h:50
Container for Accounts, Notifications.
Definition neomutt.h:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_is_subscribed_list()

bool mutt_is_subscribed_list ( const struct Address * addr)

Is this the email address of a user-subscribed mailing list?

Definition at line 61 of file maillist.c.

62{
64 ASSERT(mod_data);
65
66 if (!mutt_regexlist_match(&mod_data->unmail, buf_string(addr->mailbox)) &&
68 {
69 return mutt_regexlist_match(&mod_data->subscribed, buf_string(addr->mailbox));
70 }
71 return false;
72}
struct RegexList subscribed
Regexes to match subscribed mailing lists.
Definition module_data.h:49
struct RegexList unsubscribed
Regexes to exclude false matches in subscribed.
Definition module_data.h:51
+ Here is the call graph for this function:
+ Here is the caller graph for this function: