#include "mutt.h"
#include "sort.h"
#include "pattern.h"
+#include "score.h"
+@import "lib-lua/base.cpkg"
+
+@package mod_score {
+ bool enable = 1;
+ /*
+ ** .pp
+ ** When this variable is \fIunset\fP, scoring is turned off. This can
+ ** be useful to selectively disable scoring for certain folders when the
+ ** ``$$score_threshold_delete'' variable and friends are used.
+ **
+ */
+ int threshold_flag = 9999;
+ /*
+ ** .pp
+ ** Messages which have been assigned a score greater than or equal to this
+ ** variable's value are automatically marked ``flagged''.
+ */
+ int threshold_delete = -1;
+ /*
+ ** .pp
+ ** Messages which have been assigned a score equal to or lower than the value
+ ** of this variable are automatically marked for deletion by Madmutt. Since
+ ** Madmutt scores are always greater than or equal to zero, the default setting
+ ** of this variable will never mark a message for deletion.
+ */
+ int threshold_read = -1;
+ /*
+ ** .pp
+ ** Messages which have been assigned a score equal to or lower than the value
+ ** of this variable are automatically marked as read by Madmutt. Since
+ ** Madmutt scores are always greater than or equal to zero, the default setting
+ ** of this variable will never mark a message read.
+ */
+};
typedef struct score_t {
char *str;
{
int i;
- if (option (OPTNEEDRESCORE) && option (OPTSCORE)) {
+ if (option (OPTNEEDRESCORE) && mod_score.enable) {
if ((Sort & SORT_MASK) == SORT_SCORE ||
(SortAux & SORT_MASK) == SORT_SCORE) {
set_option (OPTNEEDRESORT);
if (hdr->score < 0)
hdr->score = 0;
- if (hdr->score <= ScoreThresholdDelete)
+ if (hdr->score <= mod_score.threshold_delete)
_mutt_set_flag (ctx, hdr, M_DELETE, 1, upd_ctx);
- if (hdr->score <= ScoreThresholdRead)
+ if (hdr->score <= mod_score.threshold_flag)
_mutt_set_flag (ctx, hdr, M_READ, 1, upd_ctx);
- if (hdr->score >= ScoreThresholdFlag)
+ if (hdr->score >= mod_score.threshold_flag)
_mutt_set_flag (ctx, hdr, M_FLAG, 1, upd_ctx);
}
set_option (OPTNEEDRESCORE);
return 0;
}
+
+/* vim:set ft=c: */