feat(mail): Add an option in Preferences to display full email instead of name alone in mailboxes

This commit is contained in:
Hivert Quentin
2023-11-23 14:09:57 +01:00
parent 8babb23c58
commit 2e670f7e62
10 changed files with 47 additions and 7 deletions
@@ -273,7 +273,7 @@
* @desc Format the first address of a specific type with a short description.
* @returns a string of the name or the email of the envelope address type
*/
Message.prototype.$shortAddress = function (type) {
Message.prototype.$shortAddress = function (type, fullEmail) {
var address = '';
if (this[type]) {
if (angular.isString(this[type])) {
@@ -289,7 +289,16 @@
}
else if (this[type].length > 0) {
// We have an array of objects; pick the first one
address = this[type][0].name || this[type][0].email || '';
if(!fullEmail)
address = this[type][0].name || this[type][0].email || '';
else if(this[type][0].name && this[type][0].email)
address = this[type][0].name + ' <' + this[type][0].email +'>';
else if(this[type][0].name)
address = this[type][0].name;
else if(this[type][0].email)
address = this[type][0].email;
else
address = '';
}
}