#include <stdbool.h>
#include <stdint.h>
#include "mutt_commands.h"
Go to the source code of this file.
Routines for adding user scores to emails
- Authors
-
- Copyright
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
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 score.h.
◆ mutt_check_rescore()
void mutt_check_rescore |
( |
struct Mailbox * |
m | ) |
|
Do the emails need to have their scores recalculated?
- Parameters
-
Definition at line 71 of file score.c.
86 for (
int i = 0; m && i < m->
msg_count; i++)
◆ mutt_parse_score()
Parse the 'score' command - Implements Command::parse()
Definition at line 102 of file score.c.
105 struct Score *ptr = NULL, *last = NULL;
106 char *pattern = NULL, *pc = NULL;
125 for (ptr =
ScoreList, last = NULL; ptr; last = ptr, ptr = ptr->
next)
◆ mutt_parse_unscore()
◆ mutt_score_message()
void mutt_score_message |
( |
struct Mailbox * |
m, |
|
|
struct Email * |
e, |
|
|
bool |
upd_mbox |
|
) |
| |
Apply scoring to an email.
- Parameters
-
Definition at line 173 of file score.c.
175 struct Score *tmp = NULL;
183 if (tmp->
exact || (tmp->
val == 9999) || (tmp->
val == -9999))
◆ C_ScoreThresholdDelete
short C_ScoreThresholdDelete |
Config: Messages with a lower score will be automatically deleted.
Definition at line 49 of file score.c.
◆ C_ScoreThresholdFlag
short C_ScoreThresholdFlag |
Config: Messages with a greater score will be automatically flagged.
Definition at line 50 of file score.c.
◆ C_ScoreThresholdRead
short C_ScoreThresholdRead |
Config: Messages with a lower score will be automatically marked read.
Definition at line 51 of file score.c.
struct PatternList * mutt_pattern_comp(struct Context *ctx, const char *s, PatternCompFlags flags, struct Buffer *err)
Create a Pattern.
@ MUTT_FLAG
Flagged messages.
short C_ScoreThresholdDelete
Config: Messages with a lower score will be automatically deleted.
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
@ SORT_THREADS
Sort by email threads.
WHERE bool OptNeedResort
(pseudo) used to force a re-sort
struct Email ** emails
Array of Emails.
void mutt_pattern_free(struct PatternList **pat)
Free a Pattern.
int mutt_pattern_exec(struct Pattern *pat, PatternExecFlags flags, struct Mailbox *m, struct Email *e, struct PatternCache *cache)
Match a pattern against an email header.
#define MUTT_TOKEN_NO_FLAGS
No flags are set.
void mutt_score_message(struct Mailbox *m, struct Email *e, bool upd_mbox)
Apply scoring to an email.
#define MUTT_MATCH_FULL_ADDRESS
Match the full address.
#define SORT_MASK
Mask for the sort id.
#define MUTT_PC_NO_FLAGS
No flags are set.
int mutt_str_atoi(const char *str, int *dst)
Convert ASCII string to an integer.
void mutt_set_flag_update(struct Mailbox *m, struct Email *e, enum MessageType flag, bool bf, bool upd_mbox)
Set a flag on an email.
short C_ScoreThresholdFlag
Config: Messages with a greater score will be automatically flagged.
WHERE bool OptNeedRescore
(pseudo) set when the 'score' command is used
@ MUTT_READ
Messages that have been read.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
WHERE bool C_Score
Config: Use message scoring.
int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, TokenFlags flags)
Extract one token from a string.
bool exact
if this rule matches, don't evaluate any more
short C_ScoreThresholdRead
Config: Messages with a lower score will be automatically marked read.
static struct Score * ScoreList
@ SORT_SCORE
Sort by the email's score.
int msg_count
Total number of messages.
@ MUTT_CMD_SUCCESS
Success: Command worked.
@ MUTT_CMD_ERROR
Error: Can't help the user.
#define SLIST_FIRST(head)
@ MUTT_CMD_WARNING
Warning: Help given to the user.
@ MUTT_DELETE
Messages to be deleted.
WHERE short C_Sort
Config: Sort method for the index.
@ MENU_MAIN
Index panel (list of emails)
WHERE bool OptSortSubthreads
(pseudo) used when $sort_aux changes
char * mutt_buffer_strdup(const struct Buffer *buf)
Copy a Buffer's string.
char * data
Pointer to data.
The envelope/body of an email.
WHERE short C_SortAux
Config: Secondary sort method for the index.
int mutt_buffer_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
@ MENU_PAGER
Pager pager (email viewer)
size_t mutt_buffer_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Cache commonly-used patterns.
int pair
Color-pair to use when displaying in the index.