Use BODY.PEEK instead of FETCH because the latter implicitly sets the \seen

flag. Instead, explicitly set the message to read (set \seen flag) on the
server when it is marked as read locally. The reasons being:

o the local and remote status don't go out of sync leading to incorrect
  unread counts
o it makes using the same imap account with multiple clients possible
o fixes a couple of bugs with the external reader window as a side effect

CCMAIL: 71596-done@bugs.kde.org
CCMAIL: 65005-done@bugs.kde.org

svn path=/trunk/kdepim/; revision=277411
wilder-work
Till Adam 23 years ago
parent 219e8e2118
commit 271eb4bbba
  1. 4
      imapjob.cpp
  2. 16
      kmreaderwin.cpp

@ -233,8 +233,10 @@ void ImapJob::slotGetNextMessage()
} else if ( mPartSpecifier == "HEADER" ) {
path += ";SECTION=HEADER";
} else {
path += ";SECTION=" + mPartSpecifier;
path += ";SECTION=BODY.PEEK[" + mPartSpecifier +"]";
}
} else {
path += ";SECTION=BODY.PEEK";
}
url.setPath( path );
// kdDebug(5006) << "ImapJob::slotGetNextMessage - retrieve " << url.path() << endl;

@ -1407,15 +1407,17 @@ void KMReaderWin::slotTouchMessage()
{
if (message())
{
if (message()->isNew() || message()->isUnread() || message()->isRead())
message()->setStatus(KMMsgStatusRead);
if ( message()->isNew() || message()->isUnread() ) {
SerNumList serNums;
if (message()->isNew() || message()->isUnread()) {
serNums.append( message()->getMsgSerNum() );
KMCommand *command = new KMSetStatusCommand( KMMsgStatusRead, serNums );
command->start();
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!") );
}
}
}

Loading…
Cancel
Save