Changeset 1c3174


Ignore:
Timestamp:
Oct 19, 2007, 7:19:11 PM (13 years ago)
Author:
rene <rene@…>
Branches:
master
Children:
739f38
Parents:
a13713
Message:

changed way of parsing the Virtual Identity Indput Field to ensure the match with a stored Identity

File:
1 edited

Legend:

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

    ra13713 r1c3174  
    6363            vI_msgIdentityClone.initMsgIdentityTextbox_clone();
    6464            var address = vI_msgIdentityClone.elements.Obj_MsgIdentityTextbox_clone.value;
    65             var splitted = { number : 0, emails : {}, fullNames : {}, combinedNames : {} };
    66             vI.headerParser.parseHeadersWithArray(address, splitted.emails,
    67                 splitted.fullNames, splitted.combinedNames);
    68             return { name: splitted.fullNames.value[0], email: splitted.emails.value[0],
    69                     combinedName: splitted.combinedNames.value[0]}
     65           
     66            // prefer an email address separated with < >, only if not found use any other
     67            if (!address.match(/<\s*[^>\s]*@[^>\s]*\s*>/)) address.match(/<?\s*[^>\s]*@[^>\s]*\s*>?/)
     68            var name = RegExp.leftContext + RegExp.rightContext
     69            var email = RegExp.lastMatch
     70            email = email.replace(/\s+|<|>/g,"")
     71            name = name.replace(/^\s+|\s+$/g,"")
     72            vI_notificationBar.dump("## v_identity: getAddress: name '" +
     73                name + "' email '" + email + "'\n");
     74            return { name: name,
     75                 email: email,
     76                 combinedName: name + " <" + email + ">"}
    7077        },
    7178    },
Note: See TracChangeset for help on using the changeset viewer.