From 743f0f50fcfb2779f1ba16382cc0fca9b1364585 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 14 Jun 2012 10:09:04 +0200 Subject: [PATCH] Add recent argument to nnimap-find-article-by-message-id Signed-off-by: Julien Danjou --- lisp/ChangeLog | 7 +++++++ lisp/nnimap.el | 11 ++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 20a586e..9d0f184 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2012-06-14 Julien Danjou + + * nnimap.el (nnimap-find-article-by-message-id): Add docstring and + recent argument. + (nnimap-request-move-article): Use the recent option of + `nnimap-find-article-by-message-id'. + 2012-06-11 Lars Magne Ingebrigtsen * gnus-art.el (gnus-article-read-summary-keys): Protect against the key diff --git a/lisp/nnimap.el b/lisp/nnimap.el index 5bdf226..0bd45de 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -867,7 +867,7 @@ textual parts.") (cons internal-move-group (or (nnimap-find-uid-response "COPYUID" (cadr result)) (nnimap-find-article-by-message-id - internal-move-group message-id))))) + internal-move-group message-id t))))) ;; Move the article to a different method. (let ((result (eval accept-form))) (when result @@ -969,7 +969,10 @@ textual parts.") (cdr (assoc "SEARCH" (cdr result)))))))))) -(defun nnimap-find-article-by-message-id (group message-id) +(defun nnimap-find-article-by-message-id (group message-id &optional recent) + "Search for message with MESSAGE-ID in GROUP. +RECENT can be used to look only in message having the \Resent +flag set, fastening the search.." (with-current-buffer (nnimap-buffer) (erase-buffer) (unless (equal group (nnimap-group nnimap-object)) @@ -977,7 +980,9 @@ textual parts.") (setf (nnimap-examined nnimap-object) group) (nnimap-send-command "EXAMINE %S" (utf7-encode group t))) (let ((sequence - (nnimap-send-command "UID SEARCH HEADER Message-Id %S" message-id)) + (nnimap-send-command "UID SEARCH HEADER Message-Id %S%s" + message-id + (if recent " RECENT" ""))) article result) (setq result (nnimap-wait-for-response sequence)) (when (and result -- 1.7.10