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

List:       kmail-devel
Subject:    Re: [PATCH] Improved Reply-All behaviour
From:       Dirk Mueller <dmuell () gmx ! net>
Date:       2003-09-11 22:14:11
[Download RAW message or body]

On Thursday 11 September 2003 23:21, Dirk Mueller wrote:

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

argh, the patch is broken in one case. Below the fixed one. Note that this one 
puts the mailinglist in CC rather than To like before, if you're replying-all 
to a message that was received via a mailing list. 


["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 22:12:46 -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>
 
@@ -1025,43 +1026,26 @@ KMMessage* KMMessage::createReply( bool 
 
     // add From address to the list of recipients (or to the list of CC
     // recipients in case of a mailing list message ) if it's not already there
     if ( !from().isEmpty() ) {
       if ( !addressIsInAddressList( from(), recipients ) ) {
-        if ( !mailingListPostAddress.isEmpty() ) {
-          ccRecipients += from();
-          kdDebug(5006) << "Added " << from()
-                        << " to the list of CC recipients"
-                        << endl;
-        }
-        else {
-          recipients += from();
-          kdDebug(5006) << "Added " << from() << " to the list of recipients"
-                        << 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;
-        }
+        recipients += from();
+        kdDebug(5006) << "Added " << from() << " 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 +3841,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 +3855,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