diff --git a/kmfiltermgr.cpp b/kmfiltermgr.cpp index d4ec677bc..1cd5e4af3 100644 --- a/kmfiltermgr.cpp +++ b/kmfiltermgr.cpp @@ -155,7 +155,7 @@ void KMFilterMgr::endFiltering(KMMsgBase *msgBase) const int index = parent->find( msgBase ); KMMessage *msg = parent->getMsg( index ); parent->take( index ); - parent->addMsg( msg ); + parent->addMsgKeepUID( msg ); } } MessageProperty::setFiltering( msgBase, false ); diff --git a/kmfolder.h b/kmfolder.h index df3e0bcc6..fea9149ee 100644 --- a/kmfolder.h +++ b/kmfolder.h @@ -152,6 +152,13 @@ public: takes ownership of the message (deleting it in the destructor).*/ virtual int addMsg(KMMessage* msg, int* index_return = 0) = 0; + /** (Note(bo): This needs to be fixed better at a later point.) + This is overridden by dIMAP because addMsg strips the X-UID + header from the mail. */ + virtual int addMsgKeepUID(KMMessage* msg, int* index_return = 0) { + return addMsg(msg, index_return); + } + /** Called by derived classes implementation of addMsg. Emits msgAdded signals */ void emitMsgAddedSignals(int idx); diff --git a/kmfoldercachedimap.h b/kmfoldercachedimap.h index 7288ad7cd..fedb508b3 100644 --- a/kmfoldercachedimap.h +++ b/kmfoldercachedimap.h @@ -136,6 +136,9 @@ public: virtual int addMsg(KMMessage* msg, int* index_return = 0); /* internal version that doesn't remove the X-UID header */ virtual int addMsgInternal(KMMessage* msg, bool, int* index_return = 0); + virtual int addMsgKeepUID(KMMessage* msg, int* index_return = 0) { + return addMsgInternal(msg, false, index_return); + } /* Reimplemented from KMFolderMaildir */ virtual void removeMsg(int i, bool imapQuiet = FALSE);