[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kmail-devel
Subject:    [PATCH] make kio_imap use peek and kmail set imap read status
From:       Till Adam <adam () kde ! org>
Date:       2003-12-30 13:18:31
Message-ID: 200312301418.38988.adam () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]

[Attachment #4 (multipart/mixed)]


Dear imap crowd,

the attached smll patches to kio_imap4 and kmail make it:

o use peek instead of fetch to get a message, thereby _not_ setting the \seen 
   flag on the server as we do currently for each mail that is viewed
o set read status explicitely just like for local mails

This has several advantages:

o local and imap status don't go out of sync resulting in wrong unread counts.   
   There are bugs about this.
o mail doesn't magically become read just because it was synced with dimap 
   (I think. Bo?) There are bugs about this.
o fixes The Gassauer Scenario (TM). One kmail at work, one at home. Open a 
   folder in one, skip over a few messages, but read only few of them. Go home 
   and find all of them marked as read. Sucks. There are bugs about this as 
   well.

I've been running with those changes for a while and no problems. Since it's 
fairly late in the game for 3.2 I'm in two minds as to whether we should 
commit this. On the other hand, not committing the kio_imap4 change now, will 
mean it won't be available for the stand alone pim release either, unless we 
release kdebase along with it, which is unlikely, right?

Opinions?

till


["KMail-explicitMarkAsRead.diff" (text/x-diff)]

? Doxyfile
? _kmreaderwin.cpp
? cvs-log
? dat_01_reader_signedtext_before_canonicalization
? dat_02_reader_signedtext_after_canonicalization
? dat_03_reader.sig
? foo.diff
? html
? imapAccumulated.diff
? kmail.kdevelop
? kmail.kdevelop.filelist
? kmail.kdevelop.pcs
? kmail.kdevses
? latex
? odat_01_reader_signedtext_before_canonicalization
? odat_02_reader_signedtext_after_canonicalization
? odat_03_reader.sig
? stats.html
? tillsan.bz2
? xml
Index: kmreaderwin.cpp
===================================================================
RCS file: /home/kde/kdepim/kmail/kmreaderwin.cpp,v
retrieving revision 1.729
diff -u -3 -p -r1.729 kmreaderwin.cpp
--- kmreaderwin.cpp	30 Dec 2003 13:57:38 -0000	1.729
+++ kmreaderwin.cpp	30 Dec 2003 13:59:51 -0000
@@ -1401,15 +1401,19 @@ void KMReaderWin::slotTouchMessage()
 {
   if (message())
   {
-    if (message()->isNew() || message()->isUnread() || message()->isRead())
-      message()->setStatus(KMMsgStatusRead);
+    SerNumList serNums;
+    if (message()->isNew() || message()->isUnread()) {
+      serNums.append( message()->getMsgSerNum() );
+    }
+
+    KMCommand *command = new KMSetStatusCommand( KMMsgStatusRead, serNums );
+    command->start();
     if ( message()->isNew() || message()->isUnread() ) {
       KMMessage * receipt = message()->createMDN( MDN::ManualAction,
-						  MDN::Displayed,
-						  true /* allow GUI */ );
+        MDN::Displayed, true /* allow GUI */ );
       if ( receipt )
-	if ( !kmkernel->msgSender()->send( receipt ) ) // send or queue
-	  KMessageBox::error( this, i18n("Couldn't send MDN!") );
+        if ( !kmkernel->msgSender()->send( receipt ) ) // send or queue
+          KMessageBox::error( this, i18n("Couldn't send MDN!") );
     }
   }
 }

["kio_imap4-peek.diff" (text/x-diff)]

Index: imap4.cc
===================================================================
RCS file: /home/kde/kdebase/kioslave/imap4/imap4.cc,v
retrieving revision 1.137
diff -u -3 -p -r1.137 imap4.cc
--- imap4.cc	13 Nov 2003 21:24:56 -0000	1.137
+++ imap4.cc	30 Dec 2003 14:00:12 -0000
@@ -202,7 +202,7 @@ IMAP4Protocol::get (const KURL & _url)
     {
       if (aSection.isEmpty()) aSection = "UID RFC822";
       else if (aSection == "FLAGS" ) ; /*aSection = "UID FLAGS";*/
-      else aSection = "UID BODY[" + aSection + "]";
+      else aSection = "UID BODY.PEEK[" + aSection + "]";
     }
     if (aEnum == ITYPE_BOX || aEnum == ITYPE_DIR_AND_BOX)
     {

[Attachment #9 (application/pgp-signature)]

_______________________________________________
KMail developers mailing list
KMail-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmail-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic