summaryrefslogtreecommitdiffstats
path: root/kmail/kmcommands.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmail/kmcommands.cpp')
-rw-r--r--kmail/kmcommands.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/kmail/kmcommands.cpp b/kmail/kmcommands.cpp
index e3be3b119..d4fead489 100644
--- a/kmail/kmcommands.cpp
+++ b/kmail/kmcommands.cpp
@@ -1115,7 +1115,22 @@ KMCommand::Result KMReplyToCommand::execute()
if ( !msg || !msg->codec() ) {
return Failed;
}
- KMMessage *reply = msg->createReply( KMail::ReplySmart, mSelection );
+
+ // Find the account that held the original message
+ TQString accountName;
+ KMFolder* parentFolder = msg->parent();
+ if (parentFolder) {
+ KMFolderDir* parentFolderDir = parentFolder->parent();
+ while (parentFolderDir) {
+ TQString prettyURL = parentFolderDir->prettyURL();
+ if (prettyURL != "") {
+ accountName = prettyURL;
+ }
+ parentFolderDir = parentFolderDir->parent();
+ }
+ }
+
+ KMMessage *reply = msg->createReply( KMail::ReplySmart, mSelection, false, true, TQString(), accountName );
KMail::Composer * win = KMail::makeComposer( reply );
win->setCharset( msg->codec()->mimeName(), true );
win->setReplyFocus();