diff options
author | Alexandre Pretto Nunes <anunes@thoughtworks.com> | 2014-12-01 17:23:51 -0200 |
---|---|---|
committer | Alexandre Pretto Nunes <anunes@thoughtworks.com> | 2014-12-03 15:52:05 -0200 |
commit | f86475751520c8fde47b67bd01b80bb193e9a54a (patch) | |
tree | 11facabc94fd814498bd72b235410aadc471d22e /web-ui/app | |
parent | 9e53c0ddcdd5cd74cda0e9cb6cb05183adbe579c (diff) |
#135 Have the web-ui use the information sent by the service regarding reply and reply-all
Diffstat (limited to 'web-ui/app')
-rw-r--r-- | web-ui/app/js/services/model/mail.js | 35 |
1 files changed, 5 insertions, 30 deletions
diff --git a/web-ui/app/js/services/model/mail.js b/web-ui/app/js/services/model/mail.js index f2103262..870c6a80 100644 --- a/web-ui/app/js/services/model/mail.js +++ b/web-ui/app/js/services/model/mail.js @@ -30,15 +30,6 @@ define(['helpers/contenttype'], return this.mailbox === 'DRAFTS'; } - function normalize(recipients) { - return _.chain([recipients]) - .flatten() - .filter(function (r) { - return !_.isUndefined(r) && !_.isEmpty(r); - }) - .value(); - } - function isInTrash() { return _.contains(this.tags, 'trash'); } @@ -47,32 +38,17 @@ define(['helpers/contenttype'], this.draft_reply_for = ident; } - function recipients(){ + function replyToAddress() { return { - to: normalize(this.header.to), - cc: normalize(this.header.cc) + to: [this.replying.single], + cc: [] }; } - function replyToAddress() { - var recipients; - - if (this.isSentMail()) { - recipients = this.recipients(); - } else { - recipients = { - to: normalize(this.header.reply_to || this.header.from), - cc: [] - }; - } - - return recipients; - } - function replyToAllAddress() { return { - to: normalize([this.header.reply_to, this.header.from]), - cc: normalize(this.header.cc) + to: this.replying.all['to-field'], + cc: this.replying.all['cc-field'] }; } @@ -142,7 +118,6 @@ define(['helpers/contenttype'], this.setDraftReplyFor = setDraftReplyFor; this.replyToAddress = replyToAddress; this.replyToAllAddress = replyToAllAddress; - this.recipients = recipients; this.getMailMediaType = getMailMediaType; this.isMailMultipartAlternative = isMailMultipartAlternative; this.getMailMultiParts = getMailMultiParts; |