[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Important marks don't seem to be synced on IMAP folders



At Tue, 21 Jun 2011 11:36:50 +0100,
Matt Ford wrote:
> 
> More weird behaviour: when I filter a folder via
> 'V'->Flag->Important then if I have untagged them on the server -
> yet they remain tagged in my local IMAP cache - then the returned
> list is empty.

This is because search is done on the server.

> A bit annoying as I want to try and remove all the rogue status
> flags in my local folder.
> 
> Any thoughts?

Hi,

The problem appears to be that calling:

  (elmo-folder-list-flagged folder flag)

merges IMAP4 flags with msgdb flags, which causes a problem with the
diffing that happens in wl-summary-sync-marks. Is this expected
behavior?

To fix, we can change the definition of wl-summary-sync-marks to call
elmo-folder-list-flagged-internal directly, as at then end of this
message.

I don’t know if wl-summary-sync-marks is wrong here or if
elmo-folder-list-flagged should not be merging flags.

best, Erik

(defun wl-summary-sync-marks ()
  "Update persistent marks in summary."
  (interactive)
  (let ((mes "Updated ")
	diff diffs)
    (message "Updating marks...")
    (dolist (flag (wl-summary-get-available-flags))
      (setq diff (elmo-list-diff (elmo-folder-list-flagged-internal
				  wl-summary-buffer-elmo-folder
				  flag)
				 (elmo-folder-list-flagged
				  wl-summary-buffer-elmo-folder
				  flag 'in-msgdb)))
      (setq diffs (cadr diff))
      (setq mes (concat mes (format "-%d" (length diffs))))
      (when diffs
	(wl-summary-unset-persistent-mark flag diffs 'no-modeline 'no-server))
      (setq diffs (car diff)
	    mes (concat mes (format "/+%d %s " (length diffs) flag)))
      (when diffs
	(wl-summary-set-persistent-mark flag diffs 'no-modeline 'no-server)))
    (if (interactive-p) (message "%s" mes))))

Sent from my free software system <http://fsf.org/>.