Changeset 055153


Ignore:
Timestamp:
Jul 30, 2008, 6:30:48 PM (12 years ago)
Author:
rene <rene@…>
Branches:
master
Children:
9fb97c
Parents:
9e925d
Message:

fix for #73. if base identity is not set, use the current one, not the default one

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chrome/content/v_identity/vI_msgIdentityClone.js

    r9e925d r055153  
    142142        if (!existingId) {
    143143            var separator = null;
    144             if (!localIdentityData.id) localIdentityData.id = gAccountManager.defaultAccount.defaultIdentity.key
    145             // search the account related to this id
     144            var accountname = document.getElementById("prettyName-Prefix").getAttribute("label");
     145//          if (!localIdentityData.id) localIdentityData.id = gAccountManager.defaultAccount.defaultIdentity.key
     146
     147            // search the account related to this id and check if there is a seperator added
    146148            MenuItems = vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.firstChild.childNodes
    147149            for (var j = 0; j < MenuItems.length; j++) {
     
    149151                    separator = true; break;
    150152                }
    151                 if (MenuItems[j].getAttribute("value") == localIdentityData.id )
    152                     accountname = document.getElementById("prettyName-Prefix").getAttribute("label") + MenuItems[j].getAttribute("accountname")
     153                if (localIdentityData.id && MenuItems[j].getAttribute("value") == localIdentityData.id)
     154                    accountname += MenuItems[j].getAttribute("accountname")
    153155            }
    154156            if (!separator) vI_msgIdentityClone.addSeparatorToCloneMenu();
     
    205207       
    206208        var label = null;
     209        var accountname = vI_helper.getAccountname(vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.selectedItem);
    207210
    208211        // use getAttribute to be sure it works with TB 2.x versions
     
    220223            // so retrieve name and email directly from Identity
    221224            var identity = gAccountManager.getIdentity(vI_msgIdentityClone.elements.Obj_MsgIdentity.selectedItem.getAttribute("value"))
    222             label = identity.getUnicharAttribute("fullName") + " <" + identity.getUnicharAttribute("useremail") + ">"           
     225            label = identity.getUnicharAttribute("fullName") + " <" + identity.getUnicharAttribute("useremail") + ">"
    223226        }
    224227        else {
     
    233236                vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.base_id_key = base_id_key
    234237            }
    235            
     238            else // change presented accountname (add accountname from current MsgIdentity (original))
     239                accountname += vI_helper.getAccountname(vI_msgIdentityClone.elements.Obj_MsgIdentity); 
    236240            // set smtp-selector to the smtp of the selected Identity
    237241            vI_smtpSelector.setMenuToKey(
     
    250254        vI_msgIdentityClone.elements.Obj_MsgIdentityTextbox_clone.value = label;
    251255
    252         vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.setAttribute("accountname",
    253             vI_helper.getAccountname(vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.selectedItem));
     256        vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.setAttribute("accountname", accountname);
     257           
    254258        vI_msgIdentityClone.markAsNewAccount(vI_msgIdentityClone.isExistingIdentity());
    255259
Note: See TracChangeset for help on using the changeset viewer.