Backout Bug 952735 - Autocomplete does not work in address book for lists CLOSED TREE
authorPhilipp Kewisch <mozilla@kewis.ch>
Sun, 16 Feb 2014 18:16:53 +0100
changeset 18658 a2733a761f2b5f69c4f43f56bc1c17020af63f6c
parent 18657 fbec5015c536ae88fb5b2a0778ef58d5678c406a
child 18659 087b6a2657cb9017db8f4dd5f51f27ccbf474fc8
push idunknown
push userunknown
push dateunknown
bugs952735
Backout Bug 952735 - Autocomplete does not work in address book for lists CLOSED TREE
calendar/base/content/dialogs/calendar-event-dialog-attendees.xml
mail/components/addrbook/content/abEditListDialog.xul
mail/components/addrbook/content/abMailListDialog.xul
mailnews/addrbook/src/nsAbAutoCompleteSearch.js
mailnews/addrbook/src/nsAbLDAPAutoCompleteSearch.js
suite/mailnews/addrbook/abListOverlay.xul
--- a/calendar/base/content/dialogs/calendar-event-dialog-attendees.xml
+++ b/calendar/base/content/dialogs/calendar-event-dialog-attendees.xml
@@ -33,17 +33,16 @@
           </xul:listcell>
           <xul:listcell class="addressingWidgetCell">
             <xul:textbox id="attendeeCol3#1"
                          anonid="input"
                          class="plain textbox-addressingWidget uri-element"
                          type="autocomplete"
                          flex="1"
                          autocompletesearch="addrbook ldap"
-                         autocompletesearchparam="{}"
                          timeout="300"
                          maxrows="4"
                          completedefaultindex="true"
                          forcecomplete="true"
                          minresultsforpopup="1"
                          onblur="if (this.localName == 'textbox') document.getBindingParent(this).onBlurInput(event);"
                          ignoreblurwhilesearching="true"
                          oninput="this.setAttribute('dirty', 'true');">
--- a/mail/components/addrbook/content/abEditListDialog.xul
+++ b/mail/components/addrbook/content/abEditListDialog.xul
@@ -52,18 +52,17 @@
     <label control="addressingWidget" value="&AddressTitle.label;"/>
     <spacer style="height:0.1em"/>
 
     <listbox id="addressingWidget" style="height: 15em;" onclick="awClickEmptySpace(event.target, true)">
       <listitem class="addressingWidgetItem" allowevents="true">
         <listcell class="addressingWidgetCell">
           <textbox id="addressCol1#1" class="plain textbox-addressingWidget uri-element"
                    type="autocomplete" flex="1"
-                   autocompletesearch="addrbook ldap"
-                   autocompletesearchparam="{}" timeout="300" maxrows="4"
+                   autocompletesearch="addrbook ldap" timeout="300" maxrows="4"
                    completedefaultindex="true" forcecomplete="true"
                    minresultsforpopup="3"
                    ontextentered="awRecipientTextCommand(eventParam, this)"
                    onkeypress="handleKeyPress(this, event);"
                    onkeydown="awRecipientKeyDown(event, this);"
                    onclick="awNotAnEmptyArea(event);">
             <image onclick="this.parentNode.select();" class="person-icon"/>
           </textbox>
--- a/mail/components/addrbook/content/abMailListDialog.xul
+++ b/mail/components/addrbook/content/abMailListDialog.xul
@@ -62,18 +62,17 @@
     <label control="addressingWidget" value="&AddressTitle.label;"/>
     <spacer style="height:0.1em"/>
 
     <listbox id="addressingWidget" style="height: 15em;" onclick="awClickEmptySpace(event.target, true)">
       <listitem class="addressingWidgetItem" allowevents="true">
         <listcell class="addressingWidgetCell">
           <textbox id="addressCol1#1" class="plain textbox-addressingWidget uri-element"
                    type="autocomplete" flex="1"
-                   autocompletesearch="addrbook ldap"
-                   autocompletesearchparam="{}" timeout="300" maxrows="4"
+                   autocompletesearch="addrbook ldap" timeout="300" maxrows="4"
                    completedefaultindex="true" forcecomplete="true"
                    minresultsforpopup="3"
                    ontextentered="awRecipientTextCommand(eventParam, this)"
                    onkeypress="handleKeyPress(this, event);"
                    onkeydown="awRecipientKeyDown(event, this);"
                    onclick="awNotAnEmptyArea(event);">
             <image onclick="this.parentNode.select();" class="person-icon"/>
           </textbox>
--- a/mailnews/addrbook/src/nsAbAutoCompleteSearch.js
+++ b/mailnews/addrbook/src/nsAbAutoCompleteSearch.js
@@ -337,17 +337,17 @@ nsAbAutoCompleteSearch.prototype = {
    *
    * It is expected that aSearchParam contains the identity (if any) to use
    * for determining if an address book should be autocompleted against.
    */
   startSearch: function startSearch(aSearchString, aSearchParam,
                                     aPreviousResult, aListener) {
     let params = JSON.parse(aSearchParam);
     var result = new nsAbAutoCompleteResult(aSearchString);
-    if (params.type && !this.applicableHeaders.has(params.type)) {
+    if (!this.applicableHeaders.has(params.type)) {
       result.searchResult = ACR.RESULT_IGNORED;
       aListener.onSearchResult(this, result);
       return;
     }
 
     // If the search string isn't value, or contains a comma, or the user
     // hasn't enabled autocomplete, then just return no matches / or the
     // result ignored.
@@ -425,17 +425,17 @@ nsAbAutoCompleteSearch.prototype = {
       // We're not going to bother searching sub-directories, currently the
       // architecture forces all cards that are in mailing lists to be in ABs as
       // well, therefore by searching sub-directories (aka mailing lists) we're
       // just going to find duplicates.
       while (allABs.hasMoreElements()) {
         var dir = allABs.getNext();
 
         if (dir instanceof Components.interfaces.nsIAbDirectory &&
-            (!params.idKey || dir.useForAutocomplete(params.idKey))) {
+            dir.useForAutocomplete(params.idKey)) {
           this._searchCards(searchQuery, dir, result);
           this._searchWithinEmails(emailSearchQuery, fullString, dir, result);
         }
       }
     }
 
     if (result.matchCount) {
       result.searchResult = ACR.RESULT_SUCCESS;
--- a/mailnews/addrbook/src/nsAbLDAPAutoCompleteSearch.js
+++ b/mailnews/addrbook/src/nsAbLDAPAutoCompleteSearch.js
@@ -153,17 +153,17 @@ nsAbLDAPAutoCompleteSearch.prototype = {
     }
   },
 
   // nsIAutoCompleteSearch
 
   startSearch: function startSearch(aSearchString, aParam,
                                     aPreviousResult, aListener) {
     let params = JSON.parse(aParam);
-    let applicable = !params.type || this.applicableHeaders.has(params.type);
+    let applicable = this.applicableHeaders.has(params.type);
     let idKey = params.idKey;
 
     this._result = new nsAbLDAPAutoCompleteResult(aSearchString);
     aSearchString = aSearchString.toLocaleLowerCase();
 
     // If the search string isn't value, or contains a comma, or the user
     // hasn't enabled autocomplete, then just return no matches / or the
     // result ignored.
--- a/suite/mailnews/addrbook/abListOverlay.xul
+++ b/suite/mailnews/addrbook/abListOverlay.xul
@@ -60,18 +60,17 @@
   <listbox id="addressingWidget" style="height: 15em;"
            onclick="awClickEmptySpace(event.target, true)">
     <listitem class="addressingWidgetItem" allowevents="true">
       <listcell class="addressingWidgetCell">
         <textbox id="addressCol1#1"
                  class="plain textbox-addressingWidget uri-element"
                  type="autocomplete"
                  flex="1"
-                 autocompletesearch="addrbook ldap"
-                 autocompletesearchparam="{}" timeout="300" maxrows="4"
+                 autocompletesearch="addrbook ldap" timeout="300" maxrows="4"
                  completedefaultindex="true" forcecomplete="true"
                  minresultsforpopup="3"
                  ontextentered="awRecipientTextCommand(eventParam, this)"
                  onkeypress="handleKeyPress(this, event);"
                  onkeydown="awRecipientKeyDown(event, this);"
                  onclick="awNotAnEmptyArea(event);">
           <image onclick="awNotAnEmptyArea(event)" class="person-icon"/>
         </textbox>