https://bugs.kde.org/show_bug.cgi?id=246590
Tobias Koenig <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #1 from Tobias Koenig <tokoe kde org> 2010-12-29 12:00:13 --- commit fd1ce7087f79f0c41e8c87d4f202577b097a733e branch master Author: Tobias Koenig <[email protected]> Date: Wed Dec 29 11:57:44 2010 +0100 Always look up keys by canonical email address The original code did first try to look up the key by non-canonical email address (e.g. 'Joe User <[email protected]>') which can lead to wrong key results if there are keys with the same name but different email addresses. The fallback lookup with canonical address wouldn't be triggered in this case, because the first lookup did return a result (although a wrong one). Now we only do one lookup with the canonical email address. BUG: 246590 CCMAIL: [email protected] diff --git a/messagecomposer/keyresolver.cpp b/messagecomposer/keyresolver.cpp index 6667acd..c02e131 100644 --- a/messagecomposer/keyresolver.cpp +++ b/messagecomposer/keyresolver.cpp @@ -1666,17 +1666,9 @@ std::vector<GpgME::Key> Kleo::KeyResolver::getEncryptionKeys( const QString & pe } // Now search all public keys for matching keys - std::vector<GpgME::Key> matchingKeys = lookup( QStringList( person ) ); + std::vector<GpgME::Key> matchingKeys = lookup( QStringList( address ) ); matchingKeys.erase( std::remove_if( matchingKeys.begin(), matchingKeys.end(), NotValidEncryptionKey ), matchingKeys.end() ); - // if no keys match the complete address look for keys which match - // the canonical mail address - if ( matchingKeys.empty() ) { - matchingKeys = lookup( QStringList( address ) ); - matchingKeys.erase( std::remove_if( matchingKeys.begin(), matchingKeys.end(), - NotValidEncryptionKey ), - matchingKeys.end() ); - } // if called with quite == true (from EncryptionPreferenceCounter), we only want to // check if there are keys for this recipients, not (yet) their validity, so -- Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. _______________________________________________ Kdepim-bugs mailing list [email protected] https://mail.kde.org/mailman/listinfo/kdepim-bugs
