bugfix for scoring - age in days instead of seconds
authorHoà Viêt Dinh <dinh.viet.hoa@free.fr>
Sun, 6 May 2001 05:05:41 +0000 (05:05 +0000)
committerHoà Viêt Dinh <dinh.viet.hoa@free.fr>
Sun, 6 May 2001 05:05:41 +0000 (05:05 +0000)
src/matcher.c
src/scoring.c

index 10b3603..2e6a5a1 100644 (file)
@@ -466,10 +466,10 @@ gboolean matcherprop_match(MatcherProp * prop, MsgInfo * info)
                || matcherprop_string_match(prop, info->cc));
        case SCORING_AGE_SUP:
                t = time(NULL);
-               return (t - info->date_t) > prop->age;
+               return ((t - info->date_t) / (60 * 60 * 24)) >= prop->age;
        case SCORING_AGE_INF:
                t = time(NULL);
-               return (t - info->date_t) < prop->age;
+               return ((t - info->date_t) / (60 * 60 * 24)) <= prop->age;
        case SCORING_NEWSGROUPS:
                return matcherprop_string_match(prop, info->newsgroups);
        case SCORING_NOT_NEWSGROUPS:
index 8511e10..7e7cdde 100644 (file)
@@ -166,7 +166,7 @@ void prefs_scoring_read_config(void)
 
                g_strchomp(buf);
 
-               if (*buf != '#') {
+               if ((*buf != '#') && (*buf != '\0')) {
                        tmp = buf;
                        scoring = scoringprop_parse(&tmp);
                        if (tmp != NULL) {