NeoMutt  2020-04-24
Teaching an old dog new tricks
Go to the documentation of this file.
26 #include <stdbool.h>
27 #include <stdint.h>
29 struct Context;
30 struct Email;
31 struct EmailList;
32 struct Mailbox;
33 struct MuttThread;
35 /* These Config Variables are only used in mutt_thread.c */
36 extern bool C_DuplicateThreads;
37 extern bool C_HideLimited;
38 extern bool C_HideMissing;
39 extern bool C_HideThreadSubject;
40 extern bool C_HideTopLimited;
41 extern bool C_HideTopMissing;
42 extern bool C_NarrowTree;
43 extern bool C_SortRe;
44 extern bool C_StrictThreads;
45 extern bool C_ThreadReceived;
47 typedef uint8_t MuttThreadFlags;
49 #define MUTT_THREAD_COLLAPSE (1 << 0)
50 #define MUTT_THREAD_UNCOLLAPSE (1 << 1)
51 #define MUTT_THREAD_GET_HIDDEN (1 << 2)
52 #define MUTT_THREAD_UNREAD (1 << 3)
53 #define MUTT_THREAD_NEXT_UNREAD (1 << 4)
54 #define MUTT_THREAD_FLAGGED (1 << 5)
56 int mutt_traverse_thread(struct Context *ctx, struct Email *e, MuttThreadFlags flag);
57 #define mutt_collapse_thread(ctx, e) mutt_traverse_thread(ctx, e, MUTT_THREAD_COLLAPSE)
58 #define mutt_uncollapse_thread(ctx, e) mutt_traverse_thread(ctx, e, MUTT_THREAD_UNCOLLAPSE)
59 #define mutt_get_hidden(ctx, e) mutt_traverse_thread(ctx, e, MUTT_THREAD_GET_HIDDEN)
60 #define mutt_thread_contains_unread(ctx, e) mutt_traverse_thread(ctx, e, MUTT_THREAD_UNREAD)
61 #define mutt_thread_contains_flagged(ctx, e) mutt_traverse_thread(ctx, e, MUTT_THREAD_FLAGGED)
62 #define mutt_thread_next_unread(ctx, e) mutt_traverse_thread(ctx, e, MUTT_THREAD_NEXT_UNREAD)
64 int mutt_aside_thread(struct Email *e, bool forwards, bool subthreads);
65 #define mutt_next_thread(e) mutt_aside_thread(e, true, false)
66 #define mutt_previous_thread(e) mutt_aside_thread(e, false, false)
67 #define mutt_next_subthread(e) mutt_aside_thread(e, true, true)
68 #define mutt_previous_subthread(e) mutt_aside_thread(e, false, true)
70 void mutt_clear_threads (struct Context *ctx);
71 void mutt_draw_tree (struct Context *ctx);
72 bool mutt_link_threads (struct Email *parent, struct EmailList *children, struct Mailbox *m);
73 struct Hash * mutt_make_id_hash (struct Mailbox *m);
74 int mutt_messages_in_thread(struct Mailbox *m, struct Email *e, int flag);
75 int mutt_parent_message (struct Context *ctx, struct Email *e, bool find_root);
76 void mutt_set_vnum (struct Context *ctx);
77 struct MuttThread *mutt_sort_subthreads (struct MuttThread *thread, bool init);
78 void mutt_sort_threads (struct Context *ctx, bool init);
80 #endif /* MUTT_MUTT_THREAD_H */
The "current" mailbox.
Definition: context.h:37
bool C_DuplicateThreads
Config: Highlight messages with duplicated message IDs.
Definition: mutt_thread.c:48
int mutt_messages_in_thread(struct Mailbox *m, struct Email *e, int flag)
Count the messages in a thread.
Definition: mutt_thread.c:1414
The envelope/body of an email.
Definition: email.h:37
bool C_SortRe
Config: Sort method for the sidebar.
Definition: mutt_thread.c:55
struct Hash * mutt_make_id_hash(struct Mailbox *m)
Create a Hash Table for message-ids.
Definition: mutt_thread.c:1456
int mutt_aside_thread(struct Email *e, bool forwards, bool subthreads)
Find the next/previous (sub)thread.
Definition: mutt_thread.c:1084
A Hash Table.
Definition: hash.h:61
bool C_HideTopMissing
Config: Don&#39;t indicate missing top message, in the thread tree.
Definition: mutt_thread.c:53
bool C_StrictThreads
Config: Thread messages using &#39;In-Reply-To&#39; and &#39;References&#39; headers.
Definition: mutt_thread.c:56
struct MuttThread * parent
Parent of this Thread.
Definition: thread.h:45
bool C_NarrowTree
Config: Draw a narrower thread tree in the index.
Definition: mutt_thread.c:54
int mutt_traverse_thread(struct Context *ctx, struct Email *e, MuttThreadFlags flag)
Recurse through an email thread, matching messages.
Definition: mutt_thread.c:1234
bool C_HideThreadSubject
Config: Hide subjects that are similar to that of the parent message.
Definition: mutt_thread.c:51
void mutt_clear_threads(struct Context *ctx)
Clear the threading of message in a mailbox.
Definition: mutt_thread.c:601
uint8_t MuttThreadFlags
Definition: mutt_thread.h:47
bool C_ThreadReceived
Config: Sort threaded messages by their received date.
Definition: mutt_thread.c:57
A mailbox.
Definition: mailbox.h:81
bool mutt_link_threads(struct Email *parent, struct EmailList *children, struct Mailbox *m)
Forcibly link threads together.
Definition: mutt_thread.c:1501
bool C_HideTopLimited
Config: Don&#39;t indicate hidden top message, in the thread tree.
Definition: mutt_thread.c:52
bool C_HideMissing
Config: Don&#39;t indicate missing messages, in the thread tree.
Definition: mutt_thread.c:50
An Email conversation.
Definition: thread.h:34
void mutt_draw_tree(struct Context *ctx)
Draw a tree of threaded emails.
Definition: mutt_thread.c:285
struct MuttThread * mutt_sort_subthreads(struct MuttThread *thread, bool init)
Sort the children of a thread.
Definition: mutt_thread.c:655
void mutt_sort_threads(struct Context *ctx, bool init)
Sort email threads.
Definition: mutt_thread.c:834
void mutt_set_vnum(struct Context *ctx)
Set the virtual index number of all the messages in a mailbox.
Definition: mutt_thread.c:1197
bool C_HideLimited
Config: Don&#39;t indicate hidden messages, in the thread tree.
Definition: mutt_thread.c:49
int mutt_parent_message(struct Context *ctx, struct Email *e, bool find_root)
Find the parent of a message.
Definition: mutt_thread.c:1148