summaryrefslogtreecommitdiff
path: root/noncore/net
authoralwin <alwin>2004-03-11 01:17:05 (UTC)
committer alwin <alwin>2004-03-11 01:17:05 (UTC)
commit1361be4582b7abbd31386b9c6c899307896e508b (patch) (side-by-side diff)
tree339741826a8a1ab5c2a7c9f4b07b909674e4ad2f /noncore/net
parent9454ac48a53f3b49e03288311b71436ccacd2d04 (diff)
downloadopie-1361be4582b7abbd31386b9c6c899307896e508b.zip
opie-1361be4582b7abbd31386b9c6c899307896e508b.tar.gz
opie-1361be4582b7abbd31386b9c6c899307896e508b.tar.bz2
respect settings of reply-to if answering to a mail
Diffstat (limited to 'noncore/net') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/viewmail.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp
index 84f8a90..aa8f37a 100644
--- a/noncore/net/mail/viewmail.cpp
+++ b/noncore/net/mail/viewmail.cpp
@@ -393,49 +393,53 @@ void ViewMail::slotReply()
QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot reply yet."), tr("Ok"));
return;
}
QString rtext;
rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose
.arg( m_mail[0] )
.arg( m_mail[3] );
QString text = m_mail[2];
QStringList lines = QStringList::split(QRegExp("\\n"), text);
QStringList::Iterator it;
for (it = lines.begin(); it != lines.end(); it++)
{
rtext += "> " + *it + "\n";
}
rtext += "\n";
QString prefix;
if ( m_mail[1].find(QRegExp("^Re: .*$")) != -1) prefix = "";
else prefix = "Re: "; // no i18n on purpose
Settings *settings = new Settings();
ComposeMail composer( settings ,this, 0, true);
- composer.setTo( m_mail[0] );
+ if (m_recMail.Replyto().isEmpty()) {
+ composer.setTo( m_recMail.getFrom());
+ } else {
+ composer.setTo( m_recMail.Replyto());
+ }
composer.setSubject( prefix + m_mail[1] );
composer.setMessage( rtext );
composer.setInReplyTo(m_recMail.Msgid());
if ( QDialog::Accepted == QPEApplication::execDialog( &composer ) )
{
m_recMail.Wrapper()->answeredMail(m_recMail);
}
}
void ViewMail::slotForward()
{
if (!m_gotBody)
{
QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot forward yet."), tr("Ok"));
return;
}
QString ftext;
ftext += QString("\n----- Forwarded message from %1 -----\n\n")
.arg( m_mail[0] );
if (!m_mail[3].isNull())
ftext += QString("Date: %1\n")
.arg( m_mail[3] );