NEOMUTTOBJS= account.o addrbook.o alias.o bcache.o browser.o color.o commands.o \
complete.o compose.o compress.o conststrings.o copy.o \
curs_lib.o edit.o editmsg.o enriched.o enter.o \
- filter.o flags.o git_ver.o group.o handler.o hdrline.o help.o hook.o \
+ filter.o flags.o git_ver.o handler.o hdrline.o help.o hook.o \
index.o init.o keymap.o mailbox.o main.o menu.o muttlib.o \
mutt_account.o mutt_attach.o mutt_body.o mutt_header.o \
mutt_history.o mutt_logging.o mutt_parse.o mutt_signal.o \
# libmutt
LIBMUTT= libmutt.a
LIBMUTTOBJS= mutt/base64.o mutt/buffer.o mutt/charset.o mutt/date.o \
- mutt/envlist.o mutt/exit.o mutt/file.o mutt/hash.o \
+ mutt/envlist.o mutt/exit.o mutt/file.o mutt/group.o mutt/hash.o \
mutt/history.o mutt/list.o mutt/logging.o mutt/mapping.o \
mutt/mbyte.o mutt/md5.o mutt/memory.o mutt/path.o mutt/regex.o \
mutt/sha1.o mutt/signal.o mutt/string.o
addr = addr->next;
}
}
+ return top;
+}
+
+/**
+ * mutt_addr_remove_xrefs - Remove cross-references
+ * @param a Reference list of Addresses
+ * @param b Address list to trim
+ * @retval ptr Updated Address list
+ *
+ * Remove addresses from "b" which are contained in "a"
+ */
+struct Address *mutt_addr_remove_xrefs(struct Address *a, struct Address *b)
+{
+ struct Address *p = NULL, *prev = NULL;
+ struct Address *top = b;
+ while (b)
+ {
+ for (p = a; p; p = p->next)
+ {
+ if (mutt_addr_cmp(p, b))
+ break;
+ }
+ if (p)
+ {
+ if (prev)
+ {
+ prev->next = b->next;
+ b->next = NULL;
+ mutt_addr_free(&b);
+ b = prev;
+ }
+ else
+ {
+ top = top->next;
+ b->next = NULL;
+ mutt_addr_free(&b);
+ b = top;
+ }
+ }
+ else
+ {
+ prev = b;
+ b = b->next;
+ }
+ }
return top;
}
struct Address *mutt_addr_parse_list(struct Address *top, const char *s);
struct Address *mutt_addr_parse_list2(struct Address *p, const char *s);
void mutt_addr_qualify(struct Address *addr, const char *host);
+struct Address *mutt_addr_remove_xrefs(struct Address *a, struct Address *b);
int mutt_addr_remove_from_list(struct Address **a, const char *mailbox);
bool mutt_addr_search(struct Address *a, struct Address *lst);
void mutt_addr_set_intl(struct Address *a, char *intl_mailbox);
extern const char *GitVer;
-WHERE struct Hash *Groups; ///< Hash table of alias groups (name -> Group)
WHERE struct Hash *ReverseAliases; ///< Hash table of aliases (email address -> alias)
WHERE struct Hash *TagFormats; ///< Hash table of tag-formats (tag -> format string)
#include "alias.h"
#include "context.h"
#include "filter.h"
-#include "group.h"
#include "hcache/hcache.h"
#include "keymap.h"
#include "menu.h"
#include "curs_lib.h"
#include "edit.h"
#include "globals.h"
-#include "group.h"
#include "handler.h"
#include "hdrline.h"
#include "hook.h"
#include "mutt/mutt.h"
#include "email/lib.h"
#include "group.h"
-#include "globals.h"
-#include "send.h"
+#include "hash.h"
+#include "logging.h"
+#include "memory.h"
+#include "regex3.h"
+#include "string2.h"
+
+struct Hash *Groups;
/**
* mutt_pattern_group - Match a pattern to a Group
;
q = mutt_addr_copy_list(a, false);
- q = mutt_remove_xrefs(g->as, q);
+ q = mutt_addr_remove_xrefs(g->as, q);
*p = q;
}
#define MUTT_GROUP_H
#include <stdbool.h>
+#include "queue.h"
+#include "regex3.h"
struct Address;
struct Buffer;
+struct Hash;
+
+extern struct Hash *Groups;
#define MUTT_GROUP 0
#define MUTT_UNGROUP 1
#include <stdbool.h>
#include <stdint.h>
-#include <stdio.h>
+#include <stdlib.h>
/**
* union HashKey - The data item stored in a HashElem
* | mutt/envlist.c | @subpage envlist |
* | mutt/exit.c | @subpage exit |
* | mutt/file.c | @subpage file |
+ * | mutt/group.c | @subpage group |
* | mutt/hash.c | @subpage hash |
* | mutt/history.c | @subpage history |
* | mutt/list.c | @subpage list |
#include "envlist.h"
#include "exit.h"
#include "file.h"
+#include "group.h"
#include "hash.h"
#include "history.h"
#include "list.h"
#include "curs_lib.h"
#include "filter.h"
#include "globals.h"
-#include "group.h"
#include "handler.h"
#include "hdrline.h"
#include "mailbox.h"
}
}
-/**
- * mutt_remove_xrefs - Remove cross-references
- * @param a Reference list of Addresses
- * @param b Address list to trim
- * @retval ptr Updated Address list
- *
- * Remove addresses from "b" which are contained in "a"
- */
-struct Address *mutt_remove_xrefs(struct Address *a, struct Address *b)
-{
- struct Address *p = NULL, *prev = NULL;
-
- struct Address *top = b;
- while (b)
- {
- for (p = a; p; p = p->next)
- {
- if (mutt_addr_cmp(p, b))
- break;
- }
- if (p)
- {
- if (prev)
- {
- prev->next = b->next;
- b->next = NULL;
- mutt_addr_free(&b);
- b = prev;
- }
- else
- {
- top = top->next;
- b->next = NULL;
- mutt_addr_free(&b);
- b = top;
- }
- }
- else
- {
- prev = b;
- b = b->next;
- }
- }
- return top;
-}
-
/**
* remove_user - Remove any address which matches the current user
* @param a List of addresses
/* the CC field can get cluttered, especially with lists */
env->to = mutt_addrlist_dedupe(env->to);
env->cc = mutt_addrlist_dedupe(env->cc);
- env->cc = mutt_remove_xrefs(env->to, env->cc);
+ env->cc = mutt_addr_remove_xrefs(env->to, env->cc);
if (env->cc && !env->to)
{