Bug 462121 Reply function is broken. error identitiesCount is not defined. r=bienvenu
authorJoey Minta <jminta@gmail.com>
Fri, 13 Aug 2010 16:50:11 +0100
changeset 6156 579f8b02ac2976565b856072b5afa693476187d1
parent 6155 6a4f3da12a1e38b421cc917380e98f5b0cf69a6e
child 6157 ea32f3539d5d9a9c337a22bb150b48cc8915a14f
push idunknown
push userunknown
push dateunknown
reviewersbienvenu
bugs462121
Bug 462121 Reply function is broken. error identitiesCount is not defined. r=bienvenu
mail/base/content/mailCommands.js
--- a/mail/base/content/mailCommands.js
+++ b/mail/base/content/mailCommands.js
@@ -75,18 +75,18 @@ function getBestIdentity(identities, opt
       // was to a mailing list. In this scenario, we won't have a match based on email address.
       // Before we just give up, try and search for just a shared domain between the hint and
       // the email addresses for our identities. Hey, it is better than nothing and in the case
       // of multiple matches here, we'll end up picking the first one anyway which is what we would have done
       // if we didn't do this second search. This helps the case for corporate users where mailing lists will have the same domain
       // as one of your multiple identities.
 
       if (!identity) {
-        for (id = 0; id < identitiesCount; ++id) {
-          tempID = identities.GetElementAt(id).QueryInterface(Components.interfaces.nsIMsgIdentity);
+        let nsIMsgIdentity = Components.interfaces.nsIMsgIdentity;
+        for each (var tempID in fixIterator(identities, nsIMsgIdentity)) {
           // extract out the partial domain
           var start = tempID.email.lastIndexOf("@"); // be sure to include the @ sign in our search to reduce the risk of false positives
           if (optionalHint.search(tempID.email.slice(start).toLowerCase()) >= 0) {
             identity = tempID;
             break;
           }
         }
       }
@@ -336,24 +336,16 @@ function NewMessageToSelectedAddresses(t
       }
       composeFields.to = addressList;
       params.composeFields = composeFields;
       msgComposeService.OpenComposeWindowWithParams(null, params);
     }
   }
 }
 
-function NewFolder(name, folder)
-{
-  if (!folder || !name)
-    return;
-
-  folder.createSubfolder(name, msgWindow);
-}
-
 function Subscribe(preselectedMsgFolder)
 {
   window.openDialog("chrome://messenger/content/subscribe.xul",
                     "subscribe", "chrome,modal,titlebar,resizable=yes",
                     {folder:preselectedMsgFolder,
                       okCallback:SubscribeOKCallback});
 }