[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kmail-devel
Subject:    [PATCH] Improved Reply-All behaviour
From:       Dirk Mueller <mueller () kde ! org>
Date:       2003-09-11 21:21:27
[Download RAW message or body]

Hi, 

below a patch for your consideration that changes the way KMail handles the 
"Reply All" feature. 

Assuming you're discussing things in private email with multiple persons, so 
you have multiple addresses on CC. With this patch, KMail will implement the 
following behaviour:

a) The generated "To" header will contain the previous From: and
   the Reply-To (if it exists). BTW I'm still not happy that "Reply-All"
   currently adds both the Reply-To and the From header (if they're 
   different and not a mailinglist) to the recipients list, but thats the way
   it is currently.

b) all those, who were previously listed on "To" are added to the generated
   CC: header, unless they're already somewhere added or one of your own
   email addresses. 

This way the "To" header contains the person you're replying to, and CC: 
contains the list of the other interested parties. I believe this is much 
more logical, because "To" now lists the person you are replying _to_, 
instead of the one the person you are replying to was replying to (yes its 
confusing :) ).


-- 
> Looking for a KDE-related EMail-Alias ? Get one at kdemail.net for FREE! <

["kmmessage.diff" (text/x-diff)]

Index: kmmessage.cpp
===================================================================
RCS file: /home/kde/kdepim/kmail/kmmessage.cpp,v
retrieving revision 1.422
diff -u -5 -d -p -r1.422 kmmessage.cpp
--- kmmessage.cpp	10 Sep 2003 21:35:31 -0000	1.422
+++ kmmessage.cpp	11 Sep 2003 21:10:17 -0000
@@ -1,5 +1,6 @@
+// -*- c-basic-offset: 2 -*-
 // kmmessage.cpp
 
 // if you do not want GUI elements in here then set ALLOW_GUI to 0.
 #include <config.h>
 
@@ -1039,29 +1040,20 @@ KMMessage* KMMessage::createReply( bool 
                         << endl;
         }
       }
     }
 
-    // add only new addresses from the To header to the list of recipients
-    if( !to().isEmpty() ) {
-      QStringList list = splitEmailAddrList( to() );
-      for( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
-        if( !addressIsInAddressList( *it, recipients ) ) {
-          recipients += *it;
-          kdDebug(5006) << "Added " << *it << " to the list of recipients"
-                        << endl;
-        }
-      }
-    }
-
     // strip all my addresses from the list of recipients
     toStr = stripMyAddressesFromAddressList( recipients ).join(", ");
 
-    // the same for the cc field
-    if( !cc().isEmpty() ) {
-      // add only new addresses from the CC header to the list of CC recipients
-      QStringList list = splitEmailAddrList( cc() );
+    // merge To header and CC header into a list of CC recipients
+    if( !cc().isEmpty() || !to().isEmpty() ) {
+      QStringList list;
+      if (!to().isEmpty())
+        list += splitEmailAddrList(to());
+      if (!cc().isEmpty())
+        list += splitEmailAddrList(cc());
       for( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
         if(    !addressIsInAddressList( *it, recipients )
             && !addressIsInAddressList( *it, ccRecipients ) ) {
           ccRecipients += *it;
           kdDebug(5006) << "Added " << *it << " to the list of CC recipients"
@@ -3857,11 +3849,11 @@ QString KMMessage::expandAliases( const 
   for ( QStringList::Iterator it = recipientList.begin();
         it != recipientList.end(); ++it ) {
     if ( !expandedRecipients.isEmpty() )
       expandedRecipients += ", ";
     QString receiver = (*it).stripWhiteSpace();
-    
+
     // try to expand distribution list
     QString expandedList = KabcBridge::expandDistributionList( receiver );
     if ( !expandedList.isEmpty() ) {
       expandedRecipients += expandedList;
       continue;
@@ -3871,11 +3863,11 @@ QString KMMessage::expandAliases( const 
     QString expandedNickName = KabcBridge::expandNickName( receiver );
     if ( !expandedNickName.isEmpty() ) {
       expandedRecipients += expandedNickName;
       continue;
     }
-    
+
     // check whether the address is missing the domain part
     // FIXME: looking for '@' might be wrong
     if ( receiver.find('@') == -1 ) {
       KConfigGroup general( KMKernel::config(), "General" );
       QString defaultdomain = general.readEntry( "Default domain" );


_______________________________________________
KMail Developers mailing list
kmail@mail.kde.org
http://mail.kde.org/mailman/listinfo/kmail


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic