From fdc82913efd7a0fcd183bcd3bf420d246d5b28e7 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Thu, 19 May 2016 15:58:26 -0400 Subject: [PATCH] (js) Fix composition of new msgs from Contacts --- NEWS | 3 ++- .../js/Contacts/AddressBookController.js | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index b2bac30bf..b63badee7 100644 --- a/NEWS +++ b/NEWS @@ -2,7 +2,8 @@ ------------------ Bug fixes - - [web] fix creation of chip on blur (sgTransformOnBlur directive) + - [web] fixed creation of chip on blur (sgTransformOnBlur directive) + - [web] fixed composition of new messages from Contacts module 3.1.0 (2016-05-18) ------------------ diff --git a/UI/WebServerResources/js/Contacts/AddressBookController.js b/UI/WebServerResources/js/Contacts/AddressBookController.js index c221dad89..aa51a4595 100644 --- a/UI/WebServerResources/js/Contacts/AddressBookController.js +++ b/UI/WebServerResources/js/Contacts/AddressBookController.js @@ -140,6 +140,7 @@ // list before proceeding with message's creation account.$getMailboxes().then(function(mailboxes) { account.$newMessage().then(function(message) { + angular.extend(message.editable, { to: recipients }); $mdDialog.show({ parent: angular.element(document.body), targetEvent: $event, @@ -150,8 +151,7 @@ controllerAs: 'editor', locals: { stateAccount: account, - stateMessage: message, - stateRecipients: recipients + stateMessage: message } }); }); @@ -160,7 +160,7 @@ } function newMessageWithRecipient($event, recipient, fn) { - var recipients = [{full: fn + ' <' + recipient + '>'}]; + var recipients = [fn + ' <' + recipient + '>']; vm.newMessage($event, recipients); $event.stopPropagation(); $event.preventDefault(); @@ -172,14 +172,14 @@ _.forEach(selectedCards, function(card) { if (card.c_component == 'vcard' && card.c_mail.length) { - recipients.push({full: card.c_cn + ' <' + card.c_mail + '>'}); + recipients.push(card.c_cn + ' <' + card.c_mail + '>'); } else if (card.$isList()) { // If the list's members were already fetch, use them if (angular.isDefined(card.refs) && card.refs.length) { _.forEach(card.refs, function(ref) { if (ref.email.length) - recipients.push({full: ref.c_cn + ' <' + ref.email + '>'}); + recipients.push(ref.c_cn + ' <' + ref.email + '>'); }); } else { @@ -187,7 +187,7 @@ return card.$futureCardData.then(function(data) { _.forEach(data.refs, function(ref) { if (ref.email.length) - recipients.push({full: ref.c_cn + ' <' + ref.email + '>'}); + recipients.push(ref.c_cn + ' <' + ref.email + '>'); }); }); }));