#include <stdbool.h>
#include <string.h>
#include "mutt/mutt.h"
+#include "config/lib.h"
#include "tags.h"
/* These Config Variables are only used in email/tags.c */
-char *C_HiddenTags; ///< Config: Tags that shouldn't be displayed on screen
+struct Slist *C_HiddenTags; ///< Config: Tags that shouldn't be displayed on screen
struct Hash *TagTransforms; /**< Lookup table of alternative tag names */
{
char *new_tag_transformed = mutt_hash_find(TagTransforms, new_tag);
- struct TagNode *np = mutt_mem_calloc(1, sizeof(struct TagNode));
- np->name = mutt_str_strdup(new_tag);
- np->hidden = false;
+ struct TagNode *tn = mutt_mem_calloc(1, sizeof(struct TagNode));
+ tn->name = mutt_str_strdup(new_tag);
+ tn->hidden = false;
if (new_tag_transformed)
- np->transformed = mutt_str_strdup(new_tag_transformed);
+ tn->transformed = mutt_str_strdup(new_tag_transformed);
/* filter out hidden tags */
- if (C_HiddenTags)
- {
- char *p = strstr(C_HiddenTags, new_tag);
- size_t xsz = p ? mutt_str_strlen(new_tag) : 0;
-
- if (p && ((p == C_HiddenTags) || (p[-1] == ',') || (p[-1] == ' ')) &&
- ((p[xsz] == '\0') || (p[xsz] == ',') || (p[xsz] == ' ')))
- {
- np->hidden = true;
- }
- }
+ if (mutt_list_find(&C_HiddenTags->head, new_tag))
+ tn->hidden = true;
- STAILQ_INSERT_TAIL(head, np, entries);
+ STAILQ_INSERT_TAIL(head, tn, entries);
}
/**
#include "mutt/mutt.h"
/* These Config Variables are only used in email/tags.c */
-extern char *C_HiddenTags;
+extern struct Slist *C_HiddenTags;
extern struct Hash *TagTransforms;
** affect the generation of Message-IDs, and it will not lead to the
** cut-off of first-level domains.
*/
- { "hidden_tags", DT_STRING, &C_HiddenTags, IP "unread,draft,flagged,passed,replied,attachment,signed,encrypted" },
+ { "hidden_tags", DT_SLIST|SLIST_SEP_COMMA, &C_HiddenTags, IP "unread,draft,flagged,passed,replied,attachment,signed,encrypted" },
/*
** .pp
** This variable specifies private notmuch/imap tags which should not be printed