author | alwin <alwin> | 2004-03-11 01:17:05 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-11 01:17:05 (UTC) |
commit | 1361be4582b7abbd31386b9c6c899307896e508b (patch) (unidiff) | |
tree | 339741826a8a1ab5c2a7c9f4b07b909674e4ad2f | |
parent | 9454ac48a53f3b49e03288311b71436ccacd2d04 (diff) | |
download | opie-1361be4582b7abbd31386b9c6c899307896e508b.zip opie-1361be4582b7abbd31386b9c6c899307896e508b.tar.gz opie-1361be4582b7abbd31386b9c6c899307896e508b.tar.bz2 |
respect settings of reply-to if answering to a mail
-rw-r--r-- | noncore/net/mail/viewmail.cpp | 6 |
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() | |||
393 | QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot reply yet."), tr("Ok")); | 393 | QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot reply yet."), tr("Ok")); |
394 | return; | 394 | return; |
395 | } | 395 | } |
396 | 396 | ||
397 | QString rtext; | 397 | QString rtext; |
398 | rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose | 398 | rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose |
399 | .arg( m_mail[0] ) | 399 | .arg( m_mail[0] ) |
400 | .arg( m_mail[3] ); | 400 | .arg( m_mail[3] ); |
401 | 401 | ||
402 | QString text = m_mail[2]; | 402 | QString text = m_mail[2]; |
403 | QStringList lines = QStringList::split(QRegExp("\\n"), text); | 403 | QStringList lines = QStringList::split(QRegExp("\\n"), text); |
404 | QStringList::Iterator it; | 404 | QStringList::Iterator it; |
405 | for (it = lines.begin(); it != lines.end(); it++) | 405 | for (it = lines.begin(); it != lines.end(); it++) |
406 | { | 406 | { |
407 | rtext += "> " + *it + "\n"; | 407 | rtext += "> " + *it + "\n"; |
408 | } | 408 | } |
409 | rtext += "\n"; | 409 | rtext += "\n"; |
410 | 410 | ||
411 | QString prefix; | 411 | QString prefix; |
412 | if ( m_mail[1].find(QRegExp("^Re: .*$")) != -1) prefix = ""; | 412 | if ( m_mail[1].find(QRegExp("^Re: .*$")) != -1) prefix = ""; |
413 | else prefix = "Re: "; // no i18n on purpose | 413 | else prefix = "Re: "; // no i18n on purpose |
414 | 414 | ||
415 | Settings *settings = new Settings(); | 415 | Settings *settings = new Settings(); |
416 | ComposeMail composer( settings ,this, 0, true); | 416 | ComposeMail composer( settings ,this, 0, true); |
417 | composer.setTo( m_mail[0] ); | 417 | if (m_recMail.Replyto().isEmpty()) { |
418 | composer.setTo( m_recMail.getFrom()); | ||
419 | } else { | ||
420 | composer.setTo( m_recMail.Replyto()); | ||
421 | } | ||
418 | composer.setSubject( prefix + m_mail[1] ); | 422 | composer.setSubject( prefix + m_mail[1] ); |
419 | composer.setMessage( rtext ); | 423 | composer.setMessage( rtext ); |
420 | composer.setInReplyTo(m_recMail.Msgid()); | 424 | composer.setInReplyTo(m_recMail.Msgid()); |
421 | 425 | ||
422 | if ( QDialog::Accepted == QPEApplication::execDialog( &composer ) ) | 426 | if ( QDialog::Accepted == QPEApplication::execDialog( &composer ) ) |
423 | { | 427 | { |
424 | m_recMail.Wrapper()->answeredMail(m_recMail); | 428 | m_recMail.Wrapper()->answeredMail(m_recMail); |
425 | } | 429 | } |
426 | } | 430 | } |
427 | 431 | ||
428 | void ViewMail::slotForward() | 432 | void ViewMail::slotForward() |
429 | { | 433 | { |
430 | if (!m_gotBody) | 434 | if (!m_gotBody) |
431 | { | 435 | { |
432 | QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot forward yet."), tr("Ok")); | 436 | QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot forward yet."), tr("Ok")); |
433 | return; | 437 | return; |
434 | } | 438 | } |
435 | 439 | ||
436 | QString ftext; | 440 | QString ftext; |
437 | ftext += QString("\n----- Forwarded message from %1 -----\n\n") | 441 | ftext += QString("\n----- Forwarded message from %1 -----\n\n") |
438 | .arg( m_mail[0] ); | 442 | .arg( m_mail[0] ); |
439 | if (!m_mail[3].isNull()) | 443 | if (!m_mail[3].isNull()) |
440 | ftext += QString("Date: %1\n") | 444 | ftext += QString("Date: %1\n") |
441 | .arg( m_mail[3] ); | 445 | .arg( m_mail[3] ); |