(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:
> 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.
(In reply to Thomas D. from comment #50) mxr.mozilla. org/comm- central/ source/ mailnews/ addrbook/ src/ eSearch. js#146 lt(commentColum n, directory, card, email,
> 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://
> nsAbAutoComplet
> 146 let email = card.primaryEmail;
> 147 if (email)
> 148 this._addToResu
> 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/nsAbAutoCom pleteSearch. js#131 searchQuery, directory, result) { searchQuery, fullSearchString, directory, result) {
> _searchCards: function _searchCards(
-> _searchCards: function _searchCards(
So then when we call that function, we can just pass fullstring, too: mxr.mozilla. org/comm- central/ source/ mailnews/ addrbook/ src/nsAbAutoCom pleteSearch. js#433 ds(searchQuery, dir, result); hinEmails( emailSearchQuer y, fullString, dir, result); ds(searchQuery, fullString, dir, result);
http://
> this._searchCar
> this._searchWit
-> this._searchCar
> 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.