* | \%F | like %n, unless from self
* | \%g | message tags (e.g. notmuch tags/imap flags)
* | \%Gx | individual message tag (e.g. notmuch tags/imap flags)
- * | \%J | message tags (if present, tree unfolded, and != parent's keywords)
* | \%i | message-id
* | \%I | initials of author
+ * | \%J | message tags (if present, tree unfolded, and != parent's keywords)
* | \%K | the list to which the letter was sent (if any; otherwise: empty)
* | \%l | number of lines in the message
* | \%L | like %F, except `lists' are displayed first
int refno; /**< message number on server */
#endif
- void *tags; /* for driver that support server tagging */
+ void *tags; /**< for drivers that support server tagging */
#if defined(USE_POP) || defined(USE_IMAP) || defined(USE_NNTP) || defined(USE_NOTMUCH)
void *data; /**< driver-specific data */
void (*free_cb)(struct Header *); /**< driver-specific data free function */
return count;
}
-
-/* imap_edit_message_tags: Prompt and validate new messages tags
+/**
+ * imap_edit_message_tags - Prompt and validate new messages tags
*
* @retval 0: no valid user input
* @retval 1: buf set
- **/
+ */
static int imap_edit_message_tags(struct Context *ctx, const char *tags, char *buf)
{
char *new = NULL;
*checker == 91 || // [
*checker == 93) // ]
{
- mutt_error(_("Invalid IMAP keyworks"));
+ mutt_error(_("Invalid IMAP keywords"));
mutt_sleep(2);
return 0;
}
}
}
-/*
+/**
* imap_read_headers - Read headers from the server
*
* Changed to read many headers instead of just one. It will return the msn of
/* make sure we don't get remnants from older larger message headers */
fputs("\n\n", fp);
-
if (h.data->msn < 1 || h.data->msn > fetch_msn_end)
{
mutt_debug(1, "imap_read_headers: skipping FETCH response for "
*/
{ "hidden_tags", DT_STRING, R_NONE, UL &HiddenTags, UL "unread,draft,flagged,passed,replied,attachment,signed,encrypted" },
/*
- ** .pp
- ** This variable specifies private notmuch tags which should not be printed
- ** on screen.
- */
+ ** .pp
+ ** This variable specifies private notmuch/imap tags which should not be printed
+ ** on screen.
+ */
{ "pager_context", DT_NUMBER, R_NONE, UL &PagerContext, 0 },
/*
** .pp
static int update_header_tags(struct Header *h, notmuch_message_t *msg)
{
+#ifdef DEBUG
struct NmHdrData *data = h->data;
+#endif
notmuch_tags_t *tags = NULL;
char *new_tags = NULL;
return (mutt_get_field("Add/remove labels: ", buf, sizeof(buf), MUTT_NM_TAG) || !*buf);
}
-
static int nm_commit_message_tags(struct Context *ctx, struct Header *hdr, char *buf)
{
struct NmCtxData *data = get_ctxdata(ctx);
-/*
- * Copyright (C) 2017 Mehdi Abaakouk <sileht@sileht.net>
+/**
+ * @file
+ * Email tags/keywords/labels
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * @authors
+ * Copyright (C) 2017 Mehdi Abaakouk <sileht@sileht.net>
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * @copyright
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 2 of the License, or (at your option) any later
+ * version.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
*
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
/**
* hdr_tags_free_tag_list - free tag
- * @param[in] h: pointer to a header struct
+ * @param[in] h: pointer to a Header struct
*
* Free tag
*/
return HEADER_TAGS(h)->tags_transformed;
}
-/*
+/**
* hdr_tags_get - Get tags from a header
* @param[in] h: pointer to a header struct
*
return HEADER_TAGS(h)->tags;
}
-/*
- * hdr_tags_get - Get tags with hiddens from a header
+/**
+ * hdr_tags_get_with_hidden - Get tags with hiddens from a header
* @param[in] h: pointer to a header struct
*
* @return string tags
HEADER_TAGS(h)->tags_with_hidden = NULL;
HEADER_TAGS(h)->tag_list = NULL;
}
+
/**
- * hdr_tags_replace - Add a tag to header
+ * hdr_tags_add - Add a tag to header
* @param[in] h: pointer to a header struct
* @param[in] new_tag: string representing the new tag
*
if (HiddenTags)
{
char *p = strstr(HiddenTags, new_tag);
- size_t xsz = p ? strlen(new_tag) : 0;
+ size_t xsz = p ? mutt_strlen(new_tag) : 0;
if (p && ((p == HiddenTags) || (*(p - 1) == ',') || (*(p - 1) == ' ')) &&
((*(p + xsz) == '\0') || (*(p + xsz) == ',') || (*(p + xsz) == ' ')))
* @retval 0 If no change are made
* @retval 1 If tags are updated
*
- *
* Free current tags structures and replace it by
* new tags
*/
return 1;
}
-
int hdr_tags_editor(struct Context *ctx, const char *tags, char *buf)
{
if (ctx->mx_ops->edit_msg_tags)
return -1;
}
-
int hdr_tags_commit(struct Context *ctx, struct Header *h, char *tags)
{
if (ctx->mx_ops->commit_msg_tags)
-/*
- * Copyright (C) 2017 Mehdi Abaakouk <sileht@sileht.net>
+/**
+ * @file
+ * Email tags/keywords/labels
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * @authors
+ * Copyright (C) 2017 Mehdi Abaakouk <sileht@sileht.net>
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * @copyright
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 2 of the License, or (at your option) any later
+ * version.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
*
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _MUTT_TAG_H
#include "context.h"
/**
- * hdr_tag - Mail Header Tags
+ * struct HeaderTag - Mail Header Tags
*
* Keep a linked list of header tags and their transformed values.
* Textual tags can be transformed to symbols to save space.
*
- * @sa hdr_tags#tag_list
+ * @sa HeaderTags#tag_list
*/
struct HeaderTag
{
* struct HeaderTags - tags data attached to an email
*
* This stores all tags data associated with an email.
- *
*/
struct HeaderTags
{