   (interactive)
   (let ((n (line-number-at-pos)))
     (olm-do-command (format "Olm.toggle_task_flag %S"
-                            (olm-mail-item-entry-id-at)))
+                            (olm-summary-message-entry-id)))
     (olm-scan)
     (goto-line n)))
 


(defun olm-summary-refile ()
  (interactive)
  (let* ((from (olm-mail-item-entry-id-at))
         (folder-name (completing-read "Refile to: "
                                       (olm-folder-names)
                                       nil

         (msg-window (split-window-below 12))
         (entry-id (progn
                     (goto-line ln0)
                     (olm-summary-message-entry-id))))
    (olm-open-message entry-id msg-window))
  (olm-summary-mark-message-as-read))

(defun olm-summary-mark-message-as-read ()
  (interactive)
  (olm-do-command (format "Olm.mark_as_read %S" (olm-summary-message-entry-id))))

(defun olm-summary-scroll-message-forward ()
  (interactive)
