- Move normalizedAddress, decodeIDN, encodeIDN, normalizeAddressesAndDecodeIDNs and normalizeAddressesAndEncodeIDNs from KMMessage to libemailfunctions.

- Replace the too simple KPIM::getEmailAddr by getFirstEmailAddress/getEmailAddress.

svn path=/trunk/kdepim/; revision=376513
wilder-work
Ingo Klcker 22 years ago
parent 68abcdf385
commit ff1ff956d8
  1. 4
      headerstyle.cpp
  2. 23
      kmcommands.cpp
  3. 4
      kmcomposewin.cpp
  4. 314
      kmmessage.cpp
  5. 45
      kmmessage.h
  6. 10
      kmsearchpattern.cpp
  7. 6
      objecttreeparser.cpp

@ -267,7 +267,7 @@ namespace KMail {
if ( strategy->showHeader( "status" ) )
{
KABC::AddressBook *addressBook = KABC::StdAddressBook::self();
KABC::AddresseeList addresses = addressBook->findByEmail( KPIM::getEmailAddr( message->from() ) );
KABC::AddresseeList addresses = addressBook->findByEmail( KPIM::getFirstEmailAddress( message->from() ) );
::KIMProxy *imProxy = KMKernel::self()->imProxy();
kabcUid = addresses[0].uid();
presence = imProxy->presenceString( kabcUid );
@ -461,7 +461,7 @@ namespace KMail {
::KIMProxy *imProxy = KMKernel::self()->imProxy();
QString kabcUid;
KABC::AddressBook *addressBook = KABC::StdAddressBook::self();
KABC::AddresseeList addresses = addressBook->findByEmail( KPIM::getEmailAddr( message->from() ) );
KABC::AddresseeList addresses = addressBook->findByEmail( KPIM::getFirstEmailAddress( message->from() ) );
QString photoURL;
int photoWidth = 60;

@ -503,7 +503,7 @@ KMMailtoOpenAddrBookCommand::KMMailtoOpenAddrBookCommand( const KURL &url,
KMCommand::Result KMMailtoOpenAddrBookCommand::execute()
{
QString addr = KMMessage::decodeMailtoUrl( mUrl.path() );
KAddrBookExternal::openEmail( KPIM::getEmailAddr(addr), addr ,
KAddrBookExternal::openEmail( KPIM::getEmailAddress(addr), addr ,
parentWidget() );
return OK;
@ -677,7 +677,7 @@ KMSaveMsgCommand::KMSaveMsgCommand( QWidget *parent, KMMessage * msg )
if ( !msg ) return;
setDeletesItself( true );
// If the mail has a serial number, operate on sernums, if it does not
// we need to work with the pointer, but can be reasonably sure it won't
// we need to work with the pointer, but can be reasonably sure it won't
// go away, since it'll be an encapsulated message or one that was opened
// from an .eml file.
if ( msg->getMsgSerNum() != 0 ) {
@ -1279,7 +1279,7 @@ KMCommand::Result KMRedirectCommand::execute()
KMMessage *msg = retrievedMessage();
if ( !msg || !msg->codec() )
return Failed;
RedirectDialog dlg( parentWidget(), "redirect", true,
kmkernel->msgSender()->sendImmediate() );
if (dlg.exec()==QDialog::Rejected) return Failed;
@ -1296,7 +1296,7 @@ KMCommand::Result KMRedirectCommand::execute()
KMPrintCommand::KMPrintCommand( QWidget *parent,
KMMessage *msg, bool htmlOverride, bool htmlLoadExtOverride,
KMMessage *msg, bool htmlOverride, bool htmlLoadExtOverride,
const QTextCodec *codec )
: KMCommand( parent, msg ), mHtmlOverride( htmlOverride ),
mHtmlLoadExtOverride( htmlLoadExtOverride ), mCodec( codec )
@ -2549,28 +2549,29 @@ KMIMChatCommand::KMIMChatCommand( const KURL &url, KMMessage *msg )
KMCommand::Result KMIMChatCommand::execute()
{
kdDebug( 5006 ) << k_funcinfo << " URL is: " << mUrl << endl;
QString addr = KMMessage::decodeMailtoUrl( mUrl.path() );
// find UID for mail address
KABC::AddressBook *addressBook = KABC::StdAddressBook::self();
KABC::AddresseeList addresses = addressBook->findByEmail( KPIM::getEmailAddr( mUrl.path() ) ) ;
KABC::AddresseeList addressees = addressBook->findByEmail( KPIM::getEmailAddress( addr ) ) ;
// start chat
if( addresses.count() == 1 ) {
kmkernel->imProxy()->chatWithContact( addresses[0].uid() );
if( addressees.count() == 1 ) {
kmkernel->imProxy()->chatWithContact( addressees[0].uid() );
return OK;
}
else
{
kdDebug( 5006 ) << "Didn't find exactly one addressee, couldn't tell who to chat to for that email address. Count = " << addresses.count() << endl;
kdDebug( 5006 ) << "Didn't find exactly one addressee, couldn't tell who to chat to for that email address. Count = " << addressees.count() << endl;
QString apology;
if ( addresses.isEmpty() )
if ( addressees.isEmpty() )
apology = i18n( "There is no Address Book entry for this email address. Add them to the Address Book and then add instant messaging addresses using your preferred messaging client." );
else
{
apology = i18n( "More than one Address Book entry uses this email address:\n %1\n it is not possible to determine who to chat with." );
QStringList nameList;
KABC::AddresseeList::const_iterator it = addresses.begin();
KABC::AddresseeList::const_iterator end = addresses.end();
KABC::AddresseeList::const_iterator it = addressees.begin();
KABC::AddresseeList::const_iterator end = addressees.end();
for ( ; it != end; ++it )
{
nameList.append( (*it).realName() );

@ -3477,7 +3477,7 @@ void KMComposeWin::doSend(int aSendNow, bool saveInDrafts)
if (!saveInDrafts)
{
if ( KPIM::getEmailAddr( from() ).isEmpty() ) {
if ( KPIM::getFirstEmailAddress( from() ).isEmpty() ) {
if ( !( mShowHeaders & HDR_FROM ) ) {
mShowHeaders |= HDR_FROM;
rethinkFields( false );
@ -3885,7 +3885,7 @@ void KMComposeWin::slotIdentityChanged( uint uoid )
if( !ident.fullEmailAddr().isNull() )
mEdtFrom->setText(ident.fullEmailAddr());
// make sure the From field is shown if it does not contain a valid email address
if ( KPIM::getEmailAddr( from() ).isEmpty() )
if ( KPIM::getFirstEmailAddress( from() ).isEmpty() )
mShowHeaders |= HDR_FROM;
if ( mEdtReplyTo ) mEdtReplyTo->setText(ident.replyToAddr());
// don't overwrite the BCC field under certain circomstances

@ -17,9 +17,6 @@ using KMail::ObjectTreeParser;
#include "kmfolderindex.h"
#include "undostack.h"
#include "kmversion.h"
#include <libkpimidentities/identity.h>
#include <libkpimidentities/identitymanager.h>
#include <libemailfunctions/email.h>
#include "kmkernel.h"
#include "headerstrategy.h"
#include "globalsettings.h"
@ -27,6 +24,10 @@ using KMail::HeaderStrategy;
#include "kmaddrbook.h"
#include "kcursorsaver.h"
#include <libkpimidentities/identity.h>
#include <libkpimidentities/identitymanager.h>
#include <libemailfunctions/email.h>
#include <cryptplugwrapperlist.h>
#include <kpgpblock.h>
#include <kaddrbook.h>
@ -1730,7 +1731,7 @@ void KMMessage::setDate(const QCString& aStr)
//-----------------------------------------------------------------------------
QString KMMessage::to() const
{
return normalizeAddressesAndDecodeIDNs( headerField("To") );
return KPIM::normalizeAddressesAndDecodeIDNs( headerField("To") );
}
@ -1749,7 +1750,7 @@ QString KMMessage::toStrip() const
//-----------------------------------------------------------------------------
QString KMMessage::replyTo() const
{
return normalizeAddressesAndDecodeIDNs( headerField("Reply-To") );
return KPIM::normalizeAddressesAndDecodeIDNs( headerField("Reply-To") );
}
@ -1772,7 +1773,7 @@ QString KMMessage::cc() const
{
// get the combined contents of all Cc headers (as workaround for invalid
// messages with multiple Cc headers)
return normalizeAddressesAndDecodeIDNs( headerFields( "Cc" ).join( ", " ) );
return KPIM::normalizeAddressesAndDecodeIDNs( headerFields( "Cc" ).join( ", " ) );
}
@ -1793,7 +1794,7 @@ QString KMMessage::ccStrip() const
//-----------------------------------------------------------------------------
QString KMMessage::bcc() const
{
return normalizeAddressesAndDecodeIDNs( headerField("Bcc") );
return KPIM::normalizeAddressesAndDecodeIDNs( headerField("Bcc") );
}
@ -1827,7 +1828,7 @@ void KMMessage::setDrafts(const QString& aStr)
QString KMMessage::who() const
{
if (mParent)
return normalizeAddressesAndDecodeIDNs( headerField(mParent->whoField().utf8()) );
return KPIM::normalizeAddressesAndDecodeIDNs( headerField(mParent->whoField().utf8()) );
return from();
}
@ -1835,7 +1836,7 @@ QString KMMessage::who() const
//-----------------------------------------------------------------------------
QString KMMessage::from() const
{
return normalizeAddressesAndDecodeIDNs( headerField("From") );
return KPIM::normalizeAddressesAndDecodeIDNs( headerField("From") );
}
@ -1856,12 +1857,6 @@ QString KMMessage::fromStrip() const
return decodeRFC2047String( stripEmailAddr( rawHeaderField("From") ) );
}
//-----------------------------------------------------------------------------
QCString KMMessage::fromEmail() const
{
return KPIM::getEmailAddr( from() );
}
//-----------------------------------------------------------------------------
QString KMMessage::sender() const {
AddrSpecList asl = extractAddrSpecs( "Sender" );
@ -2170,7 +2165,7 @@ void KMMessage::setHeaderField( const QCString& aName, const QString& bValue,
{
QString value = bValue;
if ( type == Address )
value = normalizeAddressesAndEncodeIDNs( value );
value = KPIM::normalizeAddressesAndEncodeIDNs( value );
#if 0
if ( type != Unstructured )
kdDebug(5006) << "value: \"" << value << "\"" << endl;
@ -3058,7 +3053,7 @@ QString KMMessage::generateMessageId( const QString& addr )
if( !msgIdSuffix.isEmpty() )
msgIdStr += '@' + msgIdSuffix;
else
msgIdStr += '.' + encodeIDN( addr );
msgIdStr += '.' + KPIM::encodeIDN( addr );
msgIdStr += '>';
@ -3160,129 +3155,6 @@ QCString KMMessage::lf2crlf( const QCString & src )
}
//-----------------------------------------------------------------------------
QString KMMessage::normalizedAddress( const QString & displayName,
const QString & addrSpec,
const QString & comment )
{
if ( displayName.isEmpty() && comment.isEmpty() )
return addrSpec;
else if ( comment.isEmpty() )
return displayName + " <" + addrSpec + ">";
else if ( displayName.isEmpty() )
return comment + " <" + addrSpec + ">";
else
return displayName + " (" + comment + ") <" + addrSpec + ">";
}
//-----------------------------------------------------------------------------
QString KMMessage::decodeIDN( const QString & addrSpec )
{
const int atPos = addrSpec.findRev( '@' );
if ( atPos == -1 )
return QString::null;
QString idn = KIDNA::toUnicode( addrSpec.mid( atPos + 1 ) );
if ( idn.isEmpty() )
return QString::null;
return addrSpec.left( atPos + 1 ) + idn;
}
//-----------------------------------------------------------------------------
QString KMMessage::encodeIDN( const QString & addrSpec )
{
const int atPos = addrSpec.findRev( '@' );
if ( atPos == -1 )
return addrSpec;
QString idn = KIDNA::toAscii( addrSpec.mid( atPos + 1 ) );
if ( idn.isEmpty() )
return addrSpec;
return addrSpec.left( atPos + 1 ) + idn;
}
//-----------------------------------------------------------------------------
QString KMMessage::normalizeAddressesAndDecodeIDNs( const QString & str )
{
// kdDebug(5006) << "KMMessage::normalizeAddressesAndDecodeIDNs( \""
// << str << "\" )" << endl;
if( str.isEmpty() )
return str;
const QStringList addressList = KPIM::splitEmailAddrList( str );
QStringList normalizedAddressList;
QCString displayName, addrSpec, comment;
for( QStringList::ConstIterator it = addressList.begin();
( it != addressList.end() );
++it ) {
if( !(*it).isEmpty() ) {
if ( KMMessage::splitAddress( (*it).utf8(), displayName, addrSpec,
comment )
== AddressOk ) {
normalizedAddressList <<
normalizedAddress( QString::fromUtf8( displayName ),
decodeIDN( QString::fromUtf8( addrSpec ) ),
QString::fromUtf8( comment ) );
}
else {
kdDebug(5006) << "splitting address failed: " << *it << endl;
}
}
}
/*
kdDebug(5006) << "normalizedAddressList: \""
<< normalizedAddressList.join( ", " )
<< "\"" << endl;
*/
return normalizedAddressList.join( ", " );
}
//-----------------------------------------------------------------------------
QString KMMessage::normalizeAddressesAndEncodeIDNs( const QString & str )
{
kdDebug(5006) << "KMMessage::normalizeAddressesAndEncodeIDNs( \""
<< str << "\" )" << endl;
if( str.isEmpty() )
return str;
const QStringList addressList = KPIM::splitEmailAddrList( str );
QStringList normalizedAddressList;
QCString displayName, addrSpec, comment;
for( QStringList::ConstIterator it = addressList.begin();
( it != addressList.end() );
++it ) {
if( !(*it).isEmpty() ) {
if ( KMMessage::splitAddress( (*it).utf8(), displayName, addrSpec,
comment )
== AddressOk ) {
normalizedAddressList <<
normalizedAddress( QString::fromUtf8( displayName ),
encodeIDN( QString::fromUtf8( addrSpec ) ),
QString::fromUtf8( comment ) );
}
else {
kdDebug(5006) << "splitting address failed: " << *it << endl;
}
}
}
kdDebug(5006) << "normalizedAddressList: \""
<< normalizedAddressList.join( ", " )
<< "\"" << endl;
return normalizedAddressList.join( ", " );
}
//-----------------------------------------------------------------------------
QString KMMessage::encodeMailtoUrl( const QString& str )
{
@ -3304,146 +3176,6 @@ QString KMMessage::decodeMailtoUrl( const QString& url )
}
//-----------------------------------------------------------------------------
KMMessage::AddressParseResult KMMessage::splitAddress( const QCString& address,
QCString & displayName,
QCString & addrSpec,
QCString & comment )
{
// kdDebug(5006) << "KMMessage::splitAddress( " << address << " )" << endl;
displayName = "";
addrSpec = "";
comment = "";
if ( address.isEmpty() )
return AddressEmpty;
QCString result;
// The following is a primitive parser for a mailbox-list (cf. RFC 2822).
// The purpose is to extract a displayable string from the mailboxes.
// Comments in the addr-spec are not handled. No error checking is done.
enum { TopLevel, InComment, InAngleAddress } context = TopLevel;
bool inQuotedString = false;
int commentLevel = 0;
for ( char* p = address.data(); *p; ++p ) {
switch ( context ) {
case TopLevel : {
switch ( *p ) {
case '"' : inQuotedString = !inQuotedString;
displayName += *p;
break;
case '(' : if ( !inQuotedString ) {
context = InComment;
commentLevel = 1;
}
else
displayName += *p;
break;
case '<' : if ( !inQuotedString ) {
context = InAngleAddress;
}
else
displayName += *p;
break;
case '\\' : // quoted character
displayName += *p;
++p; // skip the '\'
if ( *p )
displayName += *p;
else
return UnexpectedEnd;
break;
case ',' : if ( !inQuotedString )
return UnexpectedComma;
else
displayName += *p;
break;
default : displayName += *p;
}
break;
}
case InComment : {
switch ( *p ) {
case '(' : ++commentLevel;
comment += *p;
break;
case ')' : --commentLevel;
if ( commentLevel == 0 ) {
context = TopLevel;
comment += ' '; // separate the text of several comments
}
else
comment += *p;
break;
case '\\' : // quoted character
comment += *p;
++p; // skip the '\'
if ( *p )
comment += *p;
else
return UnexpectedEnd;
break;
default : comment += *p;
}
break;
}
case InAngleAddress : {
switch ( *p ) {
case '"' : inQuotedString = !inQuotedString;
addrSpec += *p;
break;
case '>' : if ( !inQuotedString ) {
context = TopLevel;
}
else
addrSpec += *p;
break;
case '\\' : // quoted character
addrSpec += *p;
++p; // skip the '\'
if ( *p )
addrSpec += *p;
else
return UnexpectedEnd;
break;
default : addrSpec += *p;
}
break;
}
} // switch ( context )
}
// check for errors
if ( inQuotedString )
return UnbalancedQuote;
if ( context == InComment )
return UnbalancedParens;
if ( context == InAngleAddress )
return UnclosedAngleAddr;
displayName = displayName.stripWhiteSpace();
comment = comment.stripWhiteSpace();
addrSpec = addrSpec.stripWhiteSpace();
if ( addrSpec.isEmpty() ) {
if ( displayName.isEmpty() )
return NoAddressSpec;
else {
addrSpec = displayName;
displayName.truncate( 0 );
}
}
/*
kdDebug(5006) << "display-name : \"" << displayName << "\"" << endl;
kdDebug(5006) << "comment : \"" << comment << "\"" << endl;
kdDebug(5006) << "addr-spec : \"" << addrSpec << "\"" << endl;
*/
return AddressOk;
}
//-----------------------------------------------------------------------------
QCString KMMessage::stripEmailAddr( const QCString& aStr )
{
@ -3839,11 +3571,12 @@ QString KMMessage::emailAddrAsAnchor(const QString& aEmail, bool stripped)
QStringList KMMessage::stripAddressFromAddressList( const QString& address,
const QStringList& list )
{
QStringList addresses = list;
QCString addrSpec = KPIM::getEmailAddr( address ).lower();
for( QStringList::Iterator it = addresses.begin();
QStringList addresses( list );
QString addrSpec( KPIM::getEmailAddress( address ) );
for ( QStringList::Iterator it = addresses.begin();
it != addresses.end(); ) {
if( addrSpec == KPIM::getEmailAddr( *it ).lower() ) {
if ( kasciistricmp( addrSpec.utf8().data(),
KPIM::getEmailAddress( *it ).utf8().data() ) == 0 ) {
kdDebug(5006) << "Removing " << *it << " from the address list"
<< endl;
it = addresses.remove( it );
@ -3864,7 +3597,7 @@ QStringList KMMessage::stripMyAddressesFromAddressList( const QStringList& list
it != addresses.end(); ) {
kdDebug(5006) << "Check whether " << *it << " is one of my addresses"
<< endl;
if( kmkernel->identityManager()->thatIsMe( KPIM::getEmailAddr( *it ).lower() ) ) {
if( kmkernel->identityManager()->thatIsMe( KPIM::getEmailAddress( *it ) ) ) {
kdDebug(5006) << "Removing " << *it << " from the address list"
<< endl;
it = addresses.remove( it );
@ -3881,10 +3614,11 @@ QStringList KMMessage::stripMyAddressesFromAddressList( const QStringList& list
bool KMMessage::addressIsInAddressList( const QString& address,
const QStringList& addresses )
{
QCString addrSpec = KPIM::getEmailAddr( address ).lower();
QString addrSpec = KPIM::getEmailAddress( address );
for( QStringList::ConstIterator it = addresses.begin();
it != addresses.end(); ++it ) {
if( addrSpec == KPIM::getEmailAddr( *it ).lower() )
if ( kasciistricmp( addrSpec.utf8().data(),
KPIM::getEmailAddress( *it ).utf8().data() ) == 0 )
return true;
}
return false;
@ -4186,7 +3920,7 @@ DwBodyPart* KMMessage::findDwBodyPart( DwBodyPart* part, const QString & partSpe
// encapsulated message
if ( part->Body().Message() &&
part->Body().Message()->Body().FirstBodyPart() &&
(current = findDwBodyPart( part->Body().Message()->Body().FirstBodyPart(),
(current = findDwBodyPart( part->Body().Message()->Body().FirstBodyPart(),
partSpecifier )) )
{
return current;
@ -4225,7 +3959,7 @@ void KMMessage::updateBodyPart(const QString partSpecifier, const QByteArray & d
// update headers
// get rid of EOL
content.resize( content.length()-2 );
// we have to delete the fields first as they might have been created by
// we have to delete the fields first as they might have been created by
// an earlier call to DwHeaders::FieldBody
mLastUpdated->Headers().DeleteAllFields();
mLastUpdated->Headers().FromString( content );
@ -4358,7 +4092,7 @@ QString KMMessage::bodyToUnicode(const QTextCodec* codec) const {
//-----------------------------------------------------------------------------
QCString KMMessage::mboxMessageSeparator()
{
QCString str( fromEmail() );
QCString str( KPIM::getFirstEmailAddress( rawHeaderField("From") ) );
if ( str.isEmpty() )
str = "unknown@unknown.invalid";
QCString dateStr( dateShortStr() );

@ -326,7 +326,6 @@ public:
QString from() const;
void setFrom(const QString& aStr);
QString fromStrip() const;
QCString fromEmail() const;
/** @return The addr-spec of either the Sender: (if one is given) or
* the first addr-spec in From: */
@ -613,35 +612,6 @@ public:
*/
static QCString lf2crlf( const QCString & src );
/** Returns a normalized address built from the given parts. The normalized
address is of one the following forms:
- displayName (comment) <addrSpec>
- displayName <addrSpec>
- comment <addrSpec>
- addrSpec
*/
static QString normalizedAddress( const QString & displayName,
const QString & addrSpec,
const QString & comment );
/** Decodes the punycode domain part of the given addr-spec if it's an IDN.
*/
static QString decodeIDN( const QString & addrSpec );
/** Encodes the domain part of the given addr-spec in punycode if it's an
IDN.
*/
static QString encodeIDN( const QString & addrSpec );
/** Normalizes all email addresses in the given list and decodes all IDNs.
*/
static QString normalizeAddressesAndDecodeIDNs( const QString & str );
/** Normalizes all email addresses in the given list and encodes all IDNs
in punycode.
*/
static QString normalizeAddressesAndEncodeIDNs( const QString & str );
/** Encodes an email address as mailto URL
*/
static QString encodeMailtoUrl( const QString& str );
@ -650,21 +620,6 @@ public:
*/
static QString decodeMailtoUrl( const QString& url );
enum AddressParseResult { AddressOk, AddressEmpty, NoAddressSpec,
UnbalancedQuote, UnbalancedParens,
UnclosedAngleAddr, UnexpectedComma,
UnexpectedEnd };
/** Splits the given address into display name, email address and comment.
Returns AddressOk if no error was encountered. Otherwise an appropriate
error code is returned. In case of an error the values of displayName,
addrSpec and comment are undefined.
*/
static AddressParseResult splitAddress( const QCString& address,
QCString & displayName,
QCString & addrSpec,
QCString & comment );
/** This function generates a displayable string from a list of email
addresses.
Input : mailbox-list

@ -237,7 +237,7 @@ bool KMSearchRuleString::matches( const DwString & aStr, KMMessage & msg,
if ( endOfHeader == DwString::npos )
endOfHeader = lfcrlf.FindIn( aStr, 0 );
const DwString headers = ( endOfHeader == DwString::npos ) ? aStr : aStr.substr( 0, endOfHeader );
// In case the searched header is at the beginning, we have to prepend
// In case the searched header is at the beginning, we have to prepend
// a newline - see the comment in KMSearchRuleString constructor
DwString fakedHeaders( "\n" );
size_t start = headerField->FindIn( fakedHeaders.append( headers ), 0, false );
@ -399,7 +399,7 @@ bool KMSearchRuleString::matchesInternal( const QString & msgContents ) const
for( QStringList::ConstIterator it = addressList.begin();
( it != addressList.end() );
++it ) {
if ( !stdAb->findByEmail( KPIM::getEmailAddr( *it ) ).isEmpty() )
if ( !stdAb->findByEmail( KPIM::getEmailAddress( *it ) ).isEmpty() )
return true;
}
return false;
@ -412,7 +412,7 @@ bool KMSearchRuleString::matchesInternal( const QString & msgContents ) const
for( QStringList::ConstIterator it = addressList.begin();
( it != addressList.end() );
++it ) {
if ( stdAb->findByEmail( KPIM::getEmailAddr( *it ) ).isEmpty() )
if ( stdAb->findByEmail( KPIM::getEmailAddress( *it ) ).isEmpty() )
return true;
}
return false;
@ -425,7 +425,7 @@ bool KMSearchRuleString::matchesInternal( const QString & msgContents ) const
for( QStringList::ConstIterator it = addressList.begin();
it != addressList.end(); ++it ) {
KABC::Addressee::List addresses = stdAb->findByEmail( KPIM::getEmailAddr( *it ) );
KABC::Addressee::List addresses = stdAb->findByEmail( KPIM::getEmailAddress( *it ) );
for ( KABC::Addressee::List::Iterator itAd = addresses.begin(); itAd != addresses.end(); ++itAd )
if ( (*itAd).hasCategory(category) )
@ -442,7 +442,7 @@ bool KMSearchRuleString::matchesInternal( const QString & msgContents ) const
for( QStringList::ConstIterator it = addressList.begin();
it != addressList.end(); ++it ) {
KABC::Addressee::List addresses = stdAb->findByEmail( KPIM::getEmailAddr( *it ) );
KABC::Addressee::List addresses = stdAb->findByEmail( KPIM::getEmailAddress( *it ) );
for ( KABC::Addressee::List::Iterator itAd = addresses.begin(); itAd != addresses.end(); ++itAd )
if ( (*itAd).hasCategory(category) )

@ -2,7 +2,7 @@
objecttreeparser.cpp
This file is part of KMail, the KDE mail client.
Copyright (c) 2002-2004 Klarälvdalens Datakonsult AB
Copyright (c) 2002-2004 Klarälvdalens Datakonsult AB
Copyright (c) 2003 Marc Mutz <mutz@kde.org>
KMail is free software; you can redistribute it and/or modify it
@ -1961,7 +1961,7 @@ QString ObjectTreeParser::writeSigstatHeader( PartMetaData & block,
// extra hint for green case
// that email addresses in DN do not match fromAddress
QString greenCaseWarning;
QString msgFrom( KPIM::getEmailAddr(fromAddress) );
QString msgFrom( KPIM::getEmailAddress(fromAddress) );
QString certificate;
if( block.keyId.isEmpty() )
certificate = "certificate";
@ -1994,7 +1994,7 @@ QString ObjectTreeParser::writeSigstatHeader( PartMetaData & block,
if( !bStart )
greenCaseWarning.append(", <br />&nbsp; &nbsp;");
bStart = false;
greenCaseWarning.append( KPIM::getEmailAddr(*it) );
greenCaseWarning.append( KPIM::getEmailAddress(*it) );
}
}
} else {

Loading…
Cancel
Save