diff --git a/actionscheduler.cpp b/actionscheduler.cpp index 8bb9a2e5d..c470cb5eb 100644 --- a/actionscheduler.cpp +++ b/actionscheduler.cpp @@ -694,13 +694,6 @@ void ActionScheduler::moveMessage() MessageProperty::setFilterHandler( *mMessageIt, 0 ); MessageProperty::setFiltering( *mMessageIt, false ); - // If the target folder is an online IMAP folder, make sure to keep the same - // serial number (otherwise the move commands thinks the message wasn't moved - // correctly, which would trigger the error case in moveMessageFinished(). - Q_ASSERT( folder ); - if ( folder && folder->storage() && dynamic_cast( folder->storage() ) ) - MessageProperty::setKeepSerialNumber( msg->getMsgSerNum(), true ); - mSerNums.removeAll( *mMessageIt ); KMMessage *orgMsg = 0; @@ -730,6 +723,13 @@ void ActionScheduler::moveMessage() if (msg && folder && kmkernel->folderIsTrash( folder )) KMFilterAction::sendMDN( msg, KMime::MDN::Deleted ); + // If the target folder is an online IMAP folder, make sure to keep the same + // serial number (otherwise the move commands thinks the message wasn't moved + // correctly, which would trigger the error case in moveMessageFinished(). + Q_ASSERT( folder ); + if ( folder && folder->storage() && dynamic_cast( folder->storage() ) ) + MessageProperty::setKeepSerialNumber( msg->getMsgSerNum(), true ); + timeOutTime = QTime::currentTime(); KMCommand *cmd = new KMMoveCommand( folder, msg ); connect( cmd, SIGNAL( completed( KMCommand * ) ),