[Bug 259160] Signed email cannot be marked as read [Exchange server]

Volker Krause vkrause at kde.org
Tue Dec 28 11:43:40 GMT 2010


https://bugs.kde.org/show_bug.cgi?id=259160


Volker Krause <vkrause at kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #3 from Volker Krause <vkrause kde org>  2010-12-28 12:43:39 ---
commit e6d4e256d84e170c25cdd833d69bd2d7339bc256
branch master
Author: Volker Krause <vkrause at kde.org>
Date:   Tue Dec 28 12:43:19 2010 +0100

    Do not try to write flags to the server that it does not support.

    Can happen even with servers that do support arbitrary flags, but where
    you lack access rights to change them in a specific folder.

    BUG: 259160

diff --git a/resources/imap/changeitemtask.cpp
b/resources/imap/changeitemtask.cpp
index 3ababf2..c1b4b73 100644
--- a/resources/imap/changeitemtask.cpp
+++ b/resources/imap/changeitemtask.cpp
@@ -34,6 +34,7 @@

 #include "imapflags.h"
 #include "uidnextattribute.h"
+#include "collectionflagsattribute.h"

 ChangeItemTask::ChangeItemTask( ResourceStateInterface::Ptr resource, QObject
*parent )
   : ResourceTask( DeferIfNoSession, resource, parent ), m_session( 0 ),
m_oldUid( 0 ), m_newUid( 0 )
@@ -104,11 +105,25 @@ void ChangeItemTask::onPreStoreSelectDone( KJob *job )

 void ChangeItemTask::triggerStoreJob()
 {
+  QList<QByteArray> flags = fromAkonadiFlags( item().flags().toList() );
+  Akonadi::CollectionFlagsAttribute *flagAttr =
item().parentCollection().attribute<Akonadi::CollectionFlagsAttribute>();
+  // the server does not support arbitrary flags, so filter out those it can't
handle
+  if ( flagAttr && !flagAttr->flags().isEmpty() &&
!flagAttr->flags().contains( "\\*" ) ) {
+    for ( QList< QByteArray >::iterator it = flags.begin(); it != flags.end();
) {
+      if ( flagAttr->flags().contains( *it ) ) {
+        ++it;
+      } else {
+        kDebug() << "Server does not support flag" << *it;
+        it = flags.erase( it );
+      }
+    }
+  }
+
   KIMAP::StoreJob *store = new KIMAP::StoreJob( m_session );

   store->setUidBased( true );
   store->setSequenceSet( KIMAP::ImapSet( m_oldUid ) );
-  store->setFlags( fromAkonadiFlags( item().flags().toList() ) );
+  store->setFlags( flags );
   store->setMode( KIMAP::StoreJob::SetFlags );

   connect( store, SIGNAL( result( KJob* ) ),
diff --git a/resources/imap/retrieveitemstask.cpp
b/resources/imap/retrieveitemstask.cpp
index 86917ec..196bba5 100644
--- a/resources/imap/retrieveitemstask.cpp
+++ b/resources/imap/retrieveitemstask.cpp
@@ -148,7 +148,7 @@ void RetrieveItemsTask::onFinalSelectDone( KJob *job )
   const int messageCount = select->messageCount();
   const qint64 uidValidity = select->uidValidity();
   const qint64 nextUid = select->nextUid();
-  const QList<QByteArray> flags = select->flags();
+  const QList<QByteArray> flags = select->permanentFlags();

   // uidvalidity can change between sessions, we don't want to refetch
   // folders in that case. Keep track of what is processed and what not.

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the Kdepim-bugs mailing list