From: Eric Abrahamsen Date: Wed, 18 Feb 2015 09:51:37 +0000 (+0800) Subject: Don't split imap messages back into original group X-Git-Url: http://cgit.sxemacs.org/?p=gnus;a=commitdiff_plain;h=4196f8fc4237ddd8099d54fbc1f5b0bac802f2ed Don't split imap messages back into original group * lisp/nnimap.el (nnimap-split-incoming-mail): If a message is already in the group it should be split to, don't re-copy it into the group. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b975dc7ae..72202b14f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -59,6 +59,10 @@ (gnus-registry-remove-extra-data): Use slot names rather than initarg names in `oref' and `oset'. +2015-02-27 Eric Abrahamsen + * lisp/nnimap.el (nnimap-split-incoming-mail): If a message is already + in the group it should be split to, don't re-copy it into the group. + 2015-02-25 Adam Sjøgren * message.el (message-insert-formatted-citation-line): Change %F to diff --git a/lisp/nnimap.el b/lisp/nnimap.el index 369d9d364..c476be6bc 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -2086,12 +2086,15 @@ Return the server's response to the SELECT or EXAMINE command." (ranges (cdr spec))) (if (eq group 'junk) (setq junk-articles ranges) - (push (list (nnimap-send-command - "UID COPY %s %S" - (nnimap-article-ranges ranges) - (utf7-encode group t)) - ranges) - sequences)))) + ;; Don't copy if the message is already in its + ;; target group. + (unless (string= group nnimap-inbox) + (push (list (nnimap-send-command + "UID COPY %s %S" + (nnimap-article-ranges ranges) + (utf7-encode group t)) + ranges) + sequences))))) ;; Wait for the last COPY response... (when sequences (nnimap-wait-for-response (caar sequences))