mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-06-06 19:09:43 +00:00
feat(mail): Add an option in Preferences to display full email instead of name alone in mailboxes
This commit is contained in:
@@ -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 = '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,8 +58,8 @@
|
||||
/**
|
||||
* @ngInject
|
||||
*/
|
||||
sgMessageListItemMainController.$inject = ['$scope', '$element', '$parse', '$state', '$mdUtil', '$mdToast', 'Mailbox', 'Message', 'encodeUriFilter'];
|
||||
function sgMessageListItemMainController($scope, $element, $parse, $state, $mdUtil, $mdToast, Mailbox, Message, encodeUriFilter) {
|
||||
sgMessageListItemMainController.$inject = ['$scope', '$element', '$parse', '$state', '$mdUtil', '$mdToast', 'Mailbox', 'Message', 'encodeUriFilter', 'Preferences'];
|
||||
function sgMessageListItemMainController($scope, $element, $parse, $state, $mdUtil, $mdToast, Mailbox, Message, encodeUriFilter, Preferences) {
|
||||
var $ctrl = this;
|
||||
|
||||
this.$postLink = function () {
|
||||
@@ -83,7 +83,6 @@
|
||||
threadButton = angular.element(threadButton);
|
||||
this.threadIconElement = threadButton.find('md-icon')[0];
|
||||
this.threadCountElement = threadButton.find('span')[0];
|
||||
|
||||
this.priorityIconElement = contentDivElement.find('md-icon')[0];
|
||||
|
||||
if (Mailbox.$virtualMode) {
|
||||
@@ -144,9 +143,9 @@
|
||||
|
||||
// Sender or recipient when in Sent or Draft mailbox
|
||||
if ($ctrl.MailboxService.selectedFolder.isSentFolder || $ctrl.MailboxService.selectedFolder.isDraftsFolder)
|
||||
$ctrl.senderElement.innerHTML = $ctrl.message.$shortAddress('to').encodeEntities();
|
||||
$ctrl.senderElement.innerHTML = $ctrl.message.$shortAddress('to', Preferences.defaults.SOGoMailDisplayFullEmail).encodeEntities();
|
||||
else
|
||||
$ctrl.senderElement.innerHTML = $ctrl.message.$shortAddress('from').encodeEntities();
|
||||
$ctrl.senderElement.innerHTML = $ctrl.message.$shortAddress('from', Preferences.defaults.SOGoMailDisplayFullEmail).encodeEntities();
|
||||
|
||||
// Priority icon
|
||||
if ($ctrl.message.priority && $ctrl.message.priority.level < 3) {
|
||||
|
||||
Reference in New Issue
Block a user