String processing routines to generate the mail index. More...
#include "config.h"
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include "private.h"
#include "mutt/lib.h"
#include "address/lib.h"
#include "config/lib.h"
#include "email/lib.h"
#include "core/lib.h"
#include "alias/lib.h"
#include "expando_index.h"
#include "attach/lib.h"
#include "color/lib.h"
#include "expando/lib.h"
#include "ncrypt/lib.h"
#include "hook.h"
#include "maillist.h"
#include "mutt_thread.h"
#include "muttlib.h"
#include "mx.h"
#include "subjectrx.h"
#include "notmuch/lib.h"
Go to the source code of this file.
Enumerations | |
enum | FieldType { DISP_TO , DISP_CC , DISP_BCC , DISP_FROM , DISP_PLAIN , DISP_MAX } |
Header types. More... | |
enum | IndexDateChoice { SENT_SENDER , SENT_LOCAL , RECV_LOCAL } |
Which email date to display in the Index. More... | |
Functions | |
static void | mailbox_mailbox_name (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Filename - Implements get_string_t -. | |
static const char * | make_from_prefix (enum FieldType disp) |
Create a prefix for an author field. | |
static void | make_from (struct Envelope *env, char *buf, size_t buflen, bool do_lists, MuttFormatFlags flags) |
Generate a From: field (with optional prefix) | |
static void | make_from_addr (struct Envelope *env, char *buf, size_t buflen, bool do_lists) |
Create a 'from' address for a reply email. | |
static bool | user_in_addr (struct AddressList *al) |
Do any of the addresses refer to the user? | |
static enum ToChars | user_is_recipient (struct Email *e) |
Is the user a recipient of the message. | |
static bool | thread_is_new (struct Email *e) |
Does the email thread contain any new emails? | |
static bool | thread_is_old (struct Email *e) |
Does the email thread contain any unread emails? | |
static void | index_email_date (const struct ExpandoNode *node, const struct Email *e, enum IndexDateChoice which, MuttFormatFlags flags, struct Buffer *buf, const char *format) |
Index: Sent/Received Local/Sender date and time. | |
static long | email_attachment_count (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Index: Number of MIME attachments - Implements get_number_t -. | |
static void | email_body_characters (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Number of raw bytes - Implements get_string_t -. | |
static void | email_combined_flags (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Status flags - Implements get_string_t -. | |
static void | email_crypto_flags (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Message crypto flags - Implements get_string_t -. | |
static void | email_date_format (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Sent date and time - Implements get_string_t -. | |
static void | email_date_format_local (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Sent local date and time - Implements get_string_t -. | |
static long | email_date_format_local_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Index: Local Date and time - Implements get_number_t -. | |
static long | email_date_format_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Index: Senders Date and time - Implements get_number_t -. | |
static void | email_date_strf (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Sent date and time - Implements get_string_t -. | |
static long | email_date_strf_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Index: Sender's date and time - Implements get_number_t -. | |
static void | email_date_strf_local (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Sent local date and time - Implements get_string_t -. | |
static long | email_date_strf_local_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Index: Local date and time - Implements get_number_t -. | |
static void | email_flag_chars (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Status flag - Implements get_string_t -. | |
static void | email_from_list (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: List address - Implements get_string_t -. | |
static void | email_index_hook (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: index-format-hook - Implements get_string_t -. | |
static long | email_lines (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Index: Number of lines - Implements get_number_t -. | |
static void | email_list_or_save_folder (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: List Name or Save folder - Implements get_string_t -. | |
static void | email_message_flags (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Message tag flags - Implements get_string_t -. | |
static long | email_number (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Index: Index number - Implements get_number_t -. | |
static long | email_score (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Index: Message score - Implements get_number_t -. | |
static void | email_size (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Number of bytes - Implements get_string_t -. | |
static long | email_size_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Index: Number of bytes - Implements get_number_t -. | |
static void | email_status_flags (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Message status flags - Implements get_string_t -. | |
static void | email_strf_recv_local (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Received local date and time - Implements get_string_t -. | |
static long | email_strf_recv_local_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Index: Local received date and time - Implements get_number_t -. | |
static void | email_tags (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Message tags - Implements get_string_t -. | |
static void | email_tags_transformed (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Individual tag - Implements get_string_t -. | |
static long | email_thread_count (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Index: Number of messages thread - Implements get_number_t -. | |
static void | email_thread_hidden_count (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Number of hidden messages - Implements get_string_t -. | |
static long | email_thread_hidden_count_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Index: Number of hidden messages - Implements get_number_t -. | |
static long | email_thread_number (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Index: Thread index number - Implements get_number_t -. | |
static void | email_thread_tags (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Tags - Implements get_string_t -. | |
static void | email_to_chars (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: $to_chars flag - Implements get_string_t -. | |
static void | envelope_cc_all (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Cc recipients - Implements get_string_t -. | |
static void | envelope_first_name (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: First name - Implements get_string_t -. | |
static void | envelope_from (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Author Address - Implements get_string_t -. | |
static void | envelope_from_full (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Sender - Implements get_string_t -. | |
static void | envelope_initials (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Initials of author - Implements get_string_t -. | |
static void | envelope_list_address (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Email list - Implements get_string_t -. | |
static void | envelope_list_empty (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Mailing list - Implements get_string_t -. | |
static void | envelope_message_id (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Message-id - Implements get_string_t -. | |
static void | envelope_name (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Author's real name - Implements get_string_t -. | |
static void | envelope_newsgroup (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Newsgroup name - Implements get_string_t -. | |
static void | envelope_organization (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Organization - Implements get_string_t -. | |
static void | envelope_reply_to (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Reply-to address - Implements get_string_t -. | |
static void | envelope_sender (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Author name - Implements get_string_t -. | |
static void | envelope_sender_plain (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Plain author name - Implements get_string_t -. | |
static void | envelope_spam (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Spam attributes - Implements get_string_t -. | |
static void | envelope_subject (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Subject - Implements get_string_t -. | |
static void | envelope_thread_tree (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Thread tree - Implements get_string_t -. | |
static void | envelope_thread_x_label (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: X-Label (if different) - Implements get_string_t -. | |
static void | envelope_to (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: To field - Implements get_string_t -. | |
static void | envelope_to_all (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: To recipients - Implements get_string_t -. | |
static void | envelope_username (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: User name - Implements get_string_t -. | |
static void | envelope_x_comment_to (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: X-Comment-To - Implements get_string_t -. | |
static void | envelope_x_label (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: X-Label - Implements get_string_t -. | |
static long | mailbox_message_count (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Index: Total number of message - Implements get_number_t -. | |
static void | mailbox_percentage (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Progress indicator - Implements get_string_t -. | |
Variables | |
const struct ExpandoRenderCallback | IndexRenderCallbacks [] |
Callbacks for Index Expandos. | |
String processing routines to generate the mail index.
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/.
Definition in file expando_index.c.
enum FieldType |
Header types.
Strings for printing headers
Enumerator | |
---|---|
DISP_TO | To: string. |
DISP_CC | Cc: string. |
DISP_BCC | Bcc: string. |
DISP_FROM | From: string. |
DISP_PLAIN | Empty string. |
DISP_MAX |
Definition at line 73 of file expando_index.c.
enum IndexDateChoice |
Which email date to display in the Index.
Enumerator | |
---|---|
SENT_SENDER | Date sent in the sender's timezone. |
SENT_LOCAL | Date sent in the local timezone. |
RECV_LOCAL | Date received in the local timezone. |
Definition at line 86 of file expando_index.c.
|
static |
Create a prefix for an author field.
disp | Type of field |
ptr | Prefix string (do not free it) |
If $from_chars is set, pick an appropriate character from it. If not, use the default prefix: "To", "Cc", etc
Definition at line 101 of file expando_index.c.
|
static |
Generate a From: field (with optional prefix)
env | Envelope of the email |
buf | Buffer to store the result |
buflen | Size of the buffer |
do_lists | Should we check for mailing lists? |
flags | Format flags, see MuttFormatFlags |
Generate the F or L field in $index_format. This is the author, or recipient of the email.
The field can optionally be prefixed by a character from $from_chars. If $from_chars is not set, the prefix will be, "To", "Cc", etc
Definition at line 137 of file expando_index.c.
|
static |
Create a 'from' address for a reply email.
env | Envelope of current email |
buf | Buffer for the result |
buflen | Length of buffer |
do_lists | If true, check for mailing lists |
Definition at line 193 of file expando_index.c.
|
static |
Do any of the addresses refer to the user?
al | AddressList |
true | Any of the addresses match one of the user's addresses |
Definition at line 223 of file expando_index.c.
Is the user a recipient of the message.
e | Email to test |
enum | Character index into the $to_chars config variable |
Definition at line 237 of file expando_index.c.
|
static |
Does the email thread contain any new emails?
e |
true | Thread contains new mail |
Definition at line 289 of file expando_index.c.
|
static |
Does the email thread contain any unread emails?
e |
true | Thread contains unread mail |
Definition at line 299 of file expando_index.c.
|
static |
Index: Sent/Received Local/Sender date and time.
node | ExpandoNode containing the callback |
e | |
which | Which date to use |
flags | Flags, see MuttFormatFlags |
buf | Buffer for the result |
format | Format string |
Definition at line 313 of file expando_index.c.
const struct ExpandoRenderCallback IndexRenderCallbacks[] |
Callbacks for Index Expandos.
Definition at line 1712 of file expando_index.c.