Fixed RFC number of SMTPTLS.
[elisp/wanderlust.git] / wl / wl-score.el
index 68fcc56..e0a771d 100644 (file)
@@ -176,8 +176,8 @@ Remove Re, Was, Fwd etc."
   (not (or (string< s1 s2)
           (string= s1 s2))))
 
-(defsubst wl-score-ov-entity-get (entity index &optional extra decode)
-  (elmo-message-entity-field entity (if extra (intern extra) index) decode))
+(defsubst wl-score-ov-entity-get (entity index &optional extra)
+  (elmo-message-entity-field entity (if extra (intern extra) index)))
 
 (defun wl-score-string< (a1 a2)
   (string-lessp (wl-score-ov-entity-get (car a1) wl-score-index)
@@ -367,7 +367,7 @@ Set `wl-score-cache' nil."
 (defun wl-score-headers (scores &optional force-msgs not-add)
   (let* ((elmo-mime-charset wl-summary-buffer-mime-charset)
         (folder wl-summary-buffer-elmo-folder)
-        (now (wl-day-number (current-time-string)))
+        (now (elmo-time-to-days (current-time)))
         (expire (and wl-score-expiry-days
                      (- now wl-score-expiry-days)))
         (wl-score-stop-add-entry not-add)
@@ -754,7 +754,7 @@ Set `wl-score-cache' nil."
                               expire
                               (< expire
                                  (setq day
-                                       (wl-day-number
+                                       (elmo-time-to-days
                                         (elmo-message-entity-field
                                          (car art) 'date))))))
                  (when (setq new (wl-score-add-followups
@@ -780,7 +780,7 @@ Set `wl-score-cache' nil."
       (list (cons "references" news)))))
 
 (defun wl-score-add-followups (header score scores alist &optional thread day)
-  (let* ((id (car header))
+  (let* ((id (elmo-message-entity-field header 'message-id))
         (scores (car scores))
         entry dont)
     (when id
@@ -792,7 +792,7 @@ Set `wl-score-cache' nil."
             (setq dont t)))
       (unless dont
        (let ((entry (list id score
-                          (or day (wl-day-number (current-time-string))) 's)))
+                          (or day (elmo-time-to-days (current-time))) 's)))
          (unless (or thread wl-score-stop-add-entry)
            (wl-score-update-score-entry "references" entry alist))
          (wl-score-set 'touched '(t) alist)
@@ -892,7 +892,7 @@ Set `wl-score-cache' nil."
     (wl-summary-score-effect (car entry) list (eq (nth 2 list) 'now)))))
 
 (defun wl-score-get-latest-msgs ()
-  (let* ((now (wl-day-number (current-time-string)))
+  (let* ((now (elmo-time-to-days (current-time)))
         (expire (and wl-score-expiry-days
                      (- now wl-score-expiry-days)))
         (rnumbers (reverse wl-summary-buffer-number-list))
@@ -902,11 +902,10 @@ Set `wl-score-cache' nil."
                                   nil t)
       (catch 'break
        (while rnumbers
-         (if (< (wl-day-number
-                 (elmo-message-entity-field
-                  (elmo-message-entity wl-summary-buffer-elmo-folder
-                                       (car rnumbers))
-                  'date))
+         (if (< (elmo-time-to-days
+                 (elmo-message-entity-field wl-summary-buffer-elmo-folder
+                                            (car rnumbers)
+                                            'date))
                 expire)
              (throw 'break t))
          (wl-push (car rnumbers) msgs)
@@ -920,7 +919,7 @@ Set `wl-score-cache' nil."
        (wl-score-ov-entity-get
         (elmo-message-entity wl-summary-buffer-elmo-folder
                              (wl-summary-message-number))
-        index extra decode))))
+        index extra))))
 
 (defun wl-score-kill-help-buffer ()
   (when (get-buffer "*Score Help*")
@@ -1075,7 +1074,7 @@ Set `wl-score-cache' nil."
           (perm (cond ((eq perm 'perm)
                        nil)
                       ((eq perm 'temp)
-                       (wl-day-number (current-time-string)))
+                       (elmo-time-to-days (current-time)))
                       ((eq perm 'now)
                        perm)))
           (new (list match score perm type extra)))
@@ -1195,7 +1194,7 @@ Set `wl-score-cache' nil."
              ((and wl-summary-important-above
                    (> score wl-summary-important-above))
               (if (wl-thread-jump-to-msg num);; force open
-                  (wl-summary-add-flags-internal num '(important))))
+                  (wl-summary-set-persistent-mark 'important num)))
              ((and wl-summary-target-above
                    (> score wl-summary-target-above))
               (if visible
@@ -1208,8 +1207,8 @@ Set `wl-score-cache' nil."
           (/ (* i 100) count))))
       (when dels
        (dolist (del dels)
-         (elmo-message-set-flag wl-summary-buffer-elmo-folder
-                                del 'read))
+         (elmo-message-unset-flag wl-summary-buffer-elmo-folder
+                                  del 'unread))
        (elmo-folder-kill-messages wl-summary-buffer-elmo-folder dels)
        (wl-summary-delete-messages-on-buffer dels))
       (when (and update update-unread)
@@ -1321,7 +1320,7 @@ Entering Score mode calls the value of `wl-score-mode-hook'."
 (defun wl-score-edit-insert-date ()
   "Insert date in numerical format."
   (interactive)
-  (princ (wl-day-number (current-time-string)) (current-buffer)))
+  (princ (elmo-time-to-days (current-time)) (current-buffer)))
 
 (defun wl-score-pretty-print ()
   "Format the current score file."