Skip to content

Commit

Permalink
Merge pull request #895 from pianoslum/showOwnAddressIfAmbiguous
Browse files Browse the repository at this point in the history
Show to-address like "Me (foo@bar.com)" if more than one identity is registered
  • Loading branch information
protz committed Dec 1, 2014
2 parents 5a66985 + 1e48c81 commit 4b46c28
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions modules/contact.js
Expand Up @@ -301,11 +301,15 @@ let ContactMixIn = {
getName: function _ContactMixIn_getName (aPosition, aIsDetail) {
Log.assert(aPosition === Contacts.kFrom || aPosition === Contacts.kTo,
"Someone did not set the 'position' properly");
if (getIdentityForEmail(this._email) && !aIsDetail)
return ((aPosition === Contacts.kFrom)
if (getIdentityForEmail(this._email) && !aIsDetail) {
let display = ((aPosition === Contacts.kFrom)
? strings.get("meFromMeToSomeone")
: strings.get("meFromSomeoneToMe")
);
if (getIdentities().length > 1)
display += " (" + this._email + ")";
return display;
}
else
return this._name || this._email;
},
Expand Down
8 changes: 6 additions & 2 deletions modules/monkeypatch.js
Expand Up @@ -158,11 +158,15 @@ MonkeyPatch.prototype = {
// Helper for formatting; depending on the locale, we may need a different
// for me as in "to me" or as in "from me".
let format = function (x, p) {
if (getIdentityForEmail(x.email))
return (p
if (getIdentityForEmail(x.email)) {
let display = (p
? strings.get("meBetweenMeAndSomeone")
: strings.get("meBetweenSomeoneAndMe")
);
if (getIdentities().length > 1)
display += " (" + x.email + ")";
return display;
}
else
return x.name || x.email;
};
Expand Down

0 comments on commit 4b46c28

Please sign in to comment.