(In reply to Thomas D. from comment #50)
> This looks like one of the main places where we call addToResult(...)
> function (see comment 49).
> If that's correct, one way of fixing this bug might be this:
> 
> Around here...
> 
> http://mxr.mozilla.org/comm-central/source/mailnews/addrbook/src/
> nsAbAutoCompleteSearch.js#146
> 146  let email = card.primaryEmail;
> 147           if (email)
> 148             this._addToResult(commentColumn, directory, card, email,
> true, result);
> 
> ...perhaps we could get the nick field as we now get the email field, and
> then add matches of the search fullstring (is that available here?)

fullString (user's search words) are not explicitly available here (only
inside the searchQuery argument which is passed to _searchCards
function); but I suppose we could easily make it explicitly available by
just passing it as a separate argument into _searchCards function:

http://mxr.mozilla.org/comm-central/source/mailnews/addrbook/src/nsAbAutoCompleteSearch.js#131
> _searchCards: function _searchCards(searchQuery, directory, result) {
-> _searchCards: function _searchCards(searchQuery, fullSearchString, 
directory, result) {

So then when we call that function, we can just pass fullstring, too:
http://mxr.mozilla.org/comm-central/source/mailnews/addrbook/src/nsAbAutoCompleteSearch.js#433
> this._searchCards(searchQuery, dir, result);
> this._searchWithinEmails(emailSearchQuery, fullString, dir, result);
-> this._searchCards(searchQuery, fullString, dir, result);

> against
> nick to a separate result array, say resultTop.
> Then merge resultTop Array with result array.
> 
> We also need to sort multiple nick matches on something (because
> unfortunately it's possible to have multiple cards with same nick).

Perhaps we can get away with the current sorting algorithm of
_addToResult.

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to thunderbird in Ubuntu.
https://bugs.launchpad.net/bugs/956618

Title:
  Nickname not over-riding names in email address

Status in Mozilla Thunderbird Mail and News:
  Confirmed
Status in “thunderbird” package in Ubuntu:
  New

Bug description:
  From what I have read in the support forum the nickname should take
  priority in the search for an email address in the to: field. It does
  not appear to work any more.

  Example:

  One friend's address is Mark<m...@yyyy.com>. The other is
  James<james.m...@xxxx.com>. Both are in my address book with Mark
  entered as the nickname of m...@yyyy.com  and James as nickname for
  james.m...@xxxx.com.

  If I type james in the To: field I get james.mark as a first entry in
  the list of available addresses.

  If I type mark I get the same address again, when I would prefer the
  first optional address to be m...@yyyy.com

  Reason it is needed:
  I am trying to avoid sending emails meant for m...@yyyy.com to James.mark 
because I do not notice in time that I have defaulted to the first entry in the 
list of available addresses.

  ProblemType: Bug
  DistroRelease: Ubuntu 11.10
  Package: thunderbird 10.0.2+build1-0ubuntu0.11.10.1
  ProcVersionSignature: Ubuntu 3.0.0-16.29-generic-pae 3.0.20
  Uname: Linux 3.0.0-16-generic-pae i686
  ApportVersion: 1.23-0ubuntu4
  Architecture: i386
  BuildID: 20120216123548
  Date: Fri Mar 16 00:31:06 2012
  InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release i386 (20111012)
  SourcePackage: thunderbird
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/thunderbird/+bug/956618/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to