From kmail-devel Thu Sep 11 22:14:11 2003 From: Dirk Mueller Date: Thu, 11 Sep 2003 22:14:11 +0000 To: kmail-devel Subject: Re: [PATCH] Improved Reply-All behaviour X-MARC-Message: https://marc.info/?l=kmail-devel&m=106331957907084 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_zOPY/AMAiThHEL8" --Boundary-00=_zOPY/AMAiThHEL8 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline 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. --Boundary-00=_zOPY/AMAiThHEL8 Content-Type: text/x-diff; charset="iso-8859-1"; name="kmmessage.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kmmessage.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 @@ -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" ); --Boundary-00=_zOPY/AMAiThHEL8 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ KMail Developers mailing list kmail@mail.kde.org http://mail.kde.org/mailman/listinfo/kmail --Boundary-00=_zOPY/AMAiThHEL8--