58 struct Score *sc = *sp;
88 struct Score *ptr = NULL, *last = NULL;
89 char *pattern = NULL, *patchar = NULL;
109 for (ptr = mod_data->
score_list, last = NULL; ptr; last = ptr, ptr = ptr->
next)
138 patchar = token->
data;
145 if (!mutt_str_atoi_full(patchar, &ptr->
val))
147 buf_strcpy(err,
_(
"Error: score: invalid number"));
178 struct Score *tmp = NULL, *last = NULL;
190 for (tmp = mod_data->
score_list; tmp; last = tmp, tmp = tmp->
next)
195 last->next = tmp->
next;
246 struct Score *tmp = NULL;
254 if (tmp->
exact || (tmp->
val == 9999) || (tmp->
val == -9999))
269 if (e->
score <= c_score_threshold_delete)
271 if (e->
score <= c_score_threshold_read)
273 if (e->
score >= c_score_threshold_flag)
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.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "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, 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.
Email private Module data.
bool OptNeedRescore
(pseudo) set when the 'score' command is used
bool OptNeedResort
(pseudo) used to force a re-sort
Assorted sorting methods.
EmailSortType
Methods for sorting Emails.
@ EMAIL_SORT_SCORE
Sort by the email's score.
Representation of an email.
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 parse_unscore(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'unscore' command - Implements Command::parse() -.
enum CommandResult parse_score(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'score' command - Implements Command::parse() -.
#define mutt_debug(LEVEL,...)
Convenience wrapper for the gui headers.
#define mutt_using_threads()
GUI manage the main index (list of emails)
struct MailboxView * get_current_mailbox_view(void)
Get the current Mailbox view.
@ LL_NOTIFY
Log of notifications.
#define FREE(x)
Free memory and set the pointer to NULL.
#define MUTT_MEM_CALLOC(n, type)
@ MODULE_ID_EMAIL
ModuleEmail, Email code
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.
void * neomutt_get_module_data(struct NeoMutt *n, enum ModuleId id)
Get the private data for a Module.
@ NT_SCORE
Email scoring has changed.
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.
Match patterns to emails.
#define MUTT_PC_NO_FLAGS
No flags are set.
#define MUTT_MATCH_FULL_ADDRESS
Match the full address.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
#define SLIST_FIRST(head)
void mutt_check_rescore(struct Mailbox *m)
Do the emails need to have their scores recalculated?
void mutt_score_message(struct Mailbox *m, struct Email *e, bool upd_mbox)
Apply scoring to an email.
void score_list_free(struct Score **sp)
Free a list of scoring rules.
Routines for adding user scores to emails.
String manipulation buffer.
char * data
Pointer to data.
const char * name
Name of the Command.
Email private Module data.
struct Score * score_list
Linked list of email scoring rules.
The envelope/body of an email.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
Context for config parsing (history/backtrace)
Detailed error information from config parsing.
struct Buffer * message
Error message.
Cache commonly-used patterns.
bool exact
If this rule matches, don't evaluate any more.
char * str
String to match.
struct PatternList * pat
Pattern to match.
struct Score * next
Linked list.