summaryrefslogtreecommitdiffstats
path: root/hdrline.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1999-07-01 09:45:12 +0000
committerThomas Roessler <roessler@does-not-exist.org>1999-07-01 09:45:12 +0000
commit32016c8f74f4914c71e2c006c82ab7a6c7ddebd6 (patch)
tree3bc556f813a6d8377bddefaf21c36621d56928a0 /hdrline.c
parentedfda8e884b92c31e0fe1c9a27cc32077862059f (diff)
Various patches from last week, including:
- new mh/maildir access code. - subscribe/unsubscribe - various fixes.
Diffstat (limited to 'hdrline.c')
-rw-r--r--hdrline.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/hdrline.c b/hdrline.c
index da202e36..b63b0cd8 100644
--- a/hdrline.c
+++ b/hdrline.c
@@ -32,19 +32,27 @@
#include <string.h>
#include <locale.h>
-int mutt_is_mail_list (ADDRESS *addr)
+static int _mutt_is_mail_list (ADDRESS *addr, LIST *p)
{
- LIST *p;
-
if (addr->mailbox)
{
- for (p = MailLists; p; p = p->next)
+ for (;p; p = p->next)
if (mutt_strncasecmp (addr->mailbox, p->data, mutt_strlen (p->data)) == 0)
return 1;
}
return 0;
}
+int mutt_is_mail_list (ADDRESS *addr)
+{
+ return _mutt_is_mail_list (addr, MailLists);
+}
+
+int mutt_is_subscribed_list (ADDRESS *addr)
+{
+ return _mutt_is_mail_list (addr, SubscribedLists);
+}
+
/* Search for a mailing list in the list of addresses pointed to by adr.
* If one is found, print pfx and the name of the list into buf, then
* return 1. Otherwise, simply return 0.
@@ -54,7 +62,7 @@ check_for_mailing_list (ADDRESS *adr, char *pfx, char *buf, int buflen)
{
for (; adr; adr = adr->next)
{
- if (mutt_is_mail_list (adr))
+ if (mutt_is_subscribed_list (adr))
{
if (pfx && buf && buflen)
snprintf (buf, buflen, "%s%s", pfx, mutt_get_name (adr));
@@ -73,7 +81,7 @@ check_for_mailing_list_addr (ADDRESS *adr, char *buf, int buflen)
{
for (; adr; adr = adr->next)
{
- if (mutt_is_mail_list (adr))
+ if (mutt_is_subscribed_list (adr))
{
if (buf && buflen)
snprintf (buf, buflen, "%s", adr->mailbox);
@@ -88,7 +96,7 @@ static int first_mailing_list (char *buf, size_t buflen, ADDRESS *a)
{
for (; a; a = a->next)
{
- if (mutt_is_mail_list (a))
+ if (mutt_is_subscribed_list (a))
{
mutt_save_path (buf, buflen, a);
return 1;