54 struct PatternList *
pat;
92 intptr_t data,
struct Buffer *err)
94 struct Score *ptr = NULL, *last = NULL;
95 char *pattern = NULL, *pc = NULL;
100 buf_printf(err,
_(
"%s: too few arguments"),
"score");
108 buf_printf(err,
_(
"%s: too many arguments"),
"score");
114 for (ptr =
ScoreList, last = NULL; ptr; last = ptr, ptr = ptr->
next)
149 if (!mutt_str_atoi_full(pc, &ptr->
val))
152 buf_strcpy(err,
_(
"Error: score: invalid number"));
167 struct Score *tmp = NULL;
175 if (tmp->
exact || (tmp->
val == 9999) || (tmp->
val == -9999))
190 if (e->
score <= c_score_threshold_delete)
192 if (e->
score <= c_score_threshold_read)
194 if (e->
score >= c_score_threshold_flag)
202 intptr_t data,
struct Buffer *err)
204 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.
#define SORT_MASK
Mask for the sort id.
Convenience wrapper for the core headers.
Structs that make up an email.
bool OptNeedRescore
(pseudo) set when the 'score' command is used
bool OptNeedResort
(pseudo) used to force a re-sort
EmailSortType
Methods for sorting Emails.
@ EMAIL_SORT_SCORE
Sort by the email's score.
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 OptSortSubthreads
(pseudo) used when $sort_aux changes
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.
#define MUTT_MEM_CALLOC(n, type)
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.
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.