Commit 8074c272 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix Bug 238985 - "Send Again" does not respect Reply-To header

FIXED-IN: 4.9.1
BUG: 238985
parent abc7aa1a
......@@ -80,6 +80,7 @@ class Composer : public KMail::SecondaryWindow
bool allowDecryption=false, bool isModified=false ) = 0;
virtual void setCurrentTransport( int transportId ) = 0;
virtual void setCurrentReplyTo(const QString& replyTo) = 0;
virtual void setFcc( const QString &idString ) = 0;
/**
* Returns @c true while the message composing is in progress.
......
......@@ -611,6 +611,12 @@ KMCommand::Result KMEditItemCommand::execute()
}
}
if(msg->headerByType( "Reply-To" )) {
const QString replyTo = msg->headerByType( "Reply-To" )->asUnicodeString();
win->setCurrentReplyTo(replyTo);
}
const MailTransport::SentBehaviourAttribute *sentAttribute = item.attribute<MailTransport::SentBehaviourAttribute>();
if ( sentAttribute && ( sentAttribute->sentBehaviour() == MailTransport::SentBehaviourAttribute::MoveToCollection ) )
win->setFcc( QString::number( sentAttribute->moveToCollection().id() ) );
......@@ -1519,6 +1525,10 @@ KMCommand::Result KMResendMessageCommand::execute()
newMsg->contentType()->setCharset( MessageViewer::NodeHelper::charset( msg.get() ) );
KMail::Composer * win = KMail::makeComposer();
if(msg->headerByType( "Reply-To" )) {
const QString replyTo = msg->headerByType( "Reply-To" )->asUnicodeString();
win->setCurrentReplyTo(replyTo);
}
win->setMsg( newMsg, false, true );
win->show();
......
......@@ -1487,6 +1487,13 @@ void KMComposeWin::setCurrentTransport( int transportId )
mComposerBase->transportComboBox()->setCurrentTransport( transportId );
}
void KMComposeWin::setCurrentReplyTo(const QString& replyTo)
{
if ( mEdtReplyTo ) {
mEdtReplyTo->setText( replyTo );
}
}
//-----------------------------------------------------------------------------
void KMComposeWin::setMsg( const KMime::Message::Ptr &newMsg, bool mayAutoSign,
bool allowDecryption, bool isModified )
......@@ -1501,7 +1508,6 @@ void KMComposeWin::setMsg( const KMime::Message::Ptr &newMsg, bool mayAutoSign,
KPIMIdentities::IdentityManager * im = KMKernel::self()->identityManager();
mEdtFrom->setText( mMsg->from()->asUnicodeString() );
mEdtReplyTo->setText( mMsg->replyTo()->asUnicodeString() );
mEdtSubject->setText( mMsg->subject()->asUnicodeString() );
......@@ -1629,6 +1635,8 @@ void KMComposeWin::setMsg( const KMime::Message::Ptr &newMsg, bool mayAutoSign,
mDictionaryCombo->setCurrentByDictionaryName( ident.dictionary() );
}
mEdtReplyTo->setText( mMsg->replyTo()->asUnicodeString() );
KMime::Content *msgContent = new KMime::Content;
msgContent->setContent( mMsg->encodedContent() );
msgContent->parse();
......
......@@ -230,6 +230,7 @@ class KMComposeWin : public KMail::Composer
bool insertFromMimeData( const QMimeData *source, bool forceAttachment = false );
void setCurrentReplyTo(const QString&);
private:
/**
* Write settings to app's config file.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment