<<< Date Index >>>     <<< Thread Index >>>

Patch imap_recent option to use RECENT instead of UNSEEN



Hello again!

On 2007-01-02 20:56:23, Jorgen Hermanrud Fjeld wrote:
> Hello.
> I have made a patch against a recent 1.5.13 in debian, to use
> RECENT instead of UNSEEN when checking for new email over imap.
> 
I have made a new patch against cvs, attached to this email.

> I hope you will consider applying this small patch.
> 
Is there any chance of getting this patch included soon?
I have used mutt successfully with this patch since I made it.

-- 
Sincerely | Homepage:
Jørgen    | http://www.hex.no/jhf
          | Public GPG key:
          | http://www.hex.no/jhf/key.txt
Index: init.h
===================================================================
RCS file: /home/roessler/cvs/mutt/init.h,v
retrieving revision 3.104
diff -u -r3.104 init.h
--- init.h      20 Nov 2006 17:49:56 -0000      3.104
+++ init.h      28 Jan 2007 15:52:07 -0000
@@ -916,6 +916,12 @@
   { "imap_peek", DT_BOOL, R_NONE, OPTIMAPPEEK, 1 },
   /*
   ** .pp
+  ** When \fIset\fP, mutt will use RECENT rather than UNSEEN to check
+  ** for new mail.
+  */
+  { "imap_recent", DT_BOOL, R_NONE, OPTIMAPRECENT, 0 },
+  /*
+  ** .pp
   ** When \fIset\fP, mutt will avoid implicitly marking your mail as read 
whenever
   ** you fetch a message from the server. This is generally a good thing,
   ** but can make closing an IMAP folder somewhat slower. This option
Index: mutt.h
===================================================================
RCS file: /home/roessler/cvs/mutt/mutt.h,v
retrieving revision 3.69
diff -u -r3.69 mutt.h
--- mutt.h      2 Jan 2007 17:10:34 -0000       3.69
+++ mutt.h      28 Jan 2007 15:52:08 -0000
@@ -377,6 +377,7 @@
   OPTIMAPLSUB,
   OPTIMAPPASSIVE,
   OPTIMAPPEEK,
+  OPTIMAPRECENT,
   OPTIMAPSERVERNOISE,
 #endif
 #if defined(USE_SSL)
Index: imap/command.c
===================================================================
RCS file: /home/roessler/cvs/mutt/imap/command.c,v
retrieving revision 3.48
diff -u -r3.48 command.c
--- imap/command.c      15 Aug 2006 17:08:33 -0000      3.48
+++ imap/command.c      28 Jan 2007 15:52:09 -0000
@@ -886,18 +886,26 @@
 
       if (value && !imap_mxcmp (mailbox, value))
       {
-        dprint (2, (debugfile, "Found %s in buffy list (OV: %d ON: %d U: 
%d)\n",
-                    mailbox, olduv, oldun, status->unseen));
+        dprint (2, (debugfile, "Found %s in buffy list (OV: %d ON: %d U: %d R: 
%d)\n",
+                    mailbox, olduv, oldun, status->unseen,status->recent));
         
         if (olduv && olduv == status->uidvalidity)
         {
           if (oldun < status->uidnext)
           {
-            inc->new = status->unseen;
+              if option (OPTIMAPRECENT) {
+                  inc->new = status->recent;
+              } else {
+                  inc->new = status->unseen;
+              }
           }
         }
         else
-          inc->new = status->unseen;
+            if option (OPTIMAPRECENT) {
+                inc->new = status->recent;
+            } else {
+                inc->new = status->unseen;
+            }
 
         /* forced back to keep detecting new mail until the mailbox is opened 
*/
         status->uidnext = oldun;
Index: imap/imap.c
===================================================================
RCS file: /home/roessler/cvs/mutt/imap/imap.c,v
retrieving revision 3.88
diff -u -r3.88 imap.c
--- imap/imap.c 15 Nov 2006 18:53:15 -0000      3.88
+++ imap/imap.c 28 Jan 2007 15:52:09 -0000
@@ -1466,7 +1466,7 @@
     }
     
     imap_munge_mbox_name (munged, sizeof (munged), name);
-    snprintf (command, sizeof (command), "STATUS %s (UIDNEXT UIDVALIDITY 
UNSEEN)", munged);
+    snprintf (command, sizeof (command), "STATUS %s (UIDNEXT UIDVALIDITY 
RECENT UNSEEN)", munged);
 
     if (imap_cmd_queue (idata, command) < 0)
     {

Attachment: signature.asc
Description: Digital signature