54 struct PatternList *
pat;
91 intptr_t data,
struct Buffer *err)
93 struct Score *ptr = NULL, *last = NULL;
94 char *pattern = NULL, *pc = NULL;
99 buf_printf(err,
_(
"%s: too few arguments"),
"score");
107 buf_printf(err,
_(
"%s: too many arguments"),
"score");
113 for (ptr =
ScoreList, last = NULL; ptr; last = ptr, ptr = ptr->
next)
148 if (!mutt_str_atoi_full(pc, &ptr->
val))
151 buf_strcpy(err,
_(
"Error: score: invalid number"));
166 struct Score *tmp = NULL;
174 if (tmp->
exact || (tmp->
val == 9999) || (tmp->
val == -9999))
189 if (e->
score <= c_score_threshold_delete)
191 if (e->
score <= c_score_threshold_read)
193 if (e->
score >= c_score_threshold_flag)
201 intptr_t data,
struct Buffer *err)
203 struct Score *tmp = NULL, *last = NULL;
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
char * buf_strdup(const struct Buffer *buf)
Copy a Buffer's string.
CommandResult
Error codes for command_t parse functions.
@ MUTT_CMD_SUCCESS
Success: Command worked.
@ MUTT_CMD_ERROR
Error: Can't help the user.
@ MUTT_CMD_WARNING
Warning: Help given to the user.
struct PatternList * mutt_pattern_comp(struct MailboxView *mv, struct Menu *menu, const char *s, PatternCompFlags flags, struct Buffer *err)
Create a Pattern.
void mutt_pattern_free(struct PatternList **pat)
Free a Pattern.
short cs_subset_number(const struct ConfigSubset *sub, const char *name)
Get a number config item by name.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
short cs_subset_sort(const struct ConfigSubset *sub, const char *name)
Get a sort config item by name.
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
Structs that make up an email.
bool mutt_pattern_exec(struct Pattern *pat, PatternExecFlags flags, struct Mailbox *m, struct Email *e, struct PatternCache *cache)
Match a pattern against an email header.
void mutt_set_flag(struct Mailbox *m, struct Email *e, enum MessageType flag, bool bf, bool upd_mbox)
Set a flag on an email.
bool OptNeedRescore
(pseudo) set when the 'score' command is used
bool OptSortSubthreads
(pseudo) used when $sort_aux changes
bool OptNeedResort
(pseudo) used to force a re-sort
enum CommandResult mutt_parse_unscore(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'unscore' command - Implements Command::parse() -.
enum CommandResult mutt_parse_score(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'score' command - Implements Command::parse() -.
#define mutt_debug(LEVEL,...)
GUI manage the main index (list of emails)
struct MailboxView * get_current_mailbox_view(void)
Get the current Mailbox view.
struct Menu * get_current_menu(void)
Get the current Menu.
@ LL_NOTIFY
Log of notifications.
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Convenience wrapper for the library headers.
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Many unsorted constants and some structs.
@ MUTT_READ
Messages that have been read.
@ MUTT_FLAG
Flagged messages.
@ MUTT_DELETE
Messages to be deleted.
Create/manipulate threading in emails.
#define mutt_using_threads()
@ NT_SCORE
Email scoring has changed.
Match patterns to emails.
#define MUTT_PC_NO_FLAGS
No flags are set.
#define MUTT_MATCH_FULL_ADDRESS
Match the full address.
Prototypes for many functions.
#define SLIST_FIRST(head)
void mutt_check_rescore(struct Mailbox *m)
Do the emails need to have their scores recalculated?
static struct Score * ScoreList
Linked list of email scoring rules.
void mutt_score_message(struct Mailbox *m, struct Email *e, bool upd_mbox)
Apply scoring to an email.
Routines for adding user scores to emails.
#define SORT_MASK
Mask for the sort id.
SortType
Methods for sorting.
@ SORT_SCORE
Sort by the email's score.
String manipulation buffer.
char * data
Pointer to data.
The envelope/body of an email.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
Cache commonly-used patterns.
bool exact
If this rule matches, don't evaluate any more.
struct Score * next
Linked list.