(js) Show the reply-all btn in more situations
parent
aa6c0e553e
commit
66e1b348e0
1
NEWS
1
NEWS
|
@ -3,6 +3,7 @@
|
|||
|
||||
Bug fixes
|
||||
- [web] date validator now handles non-latin characters
|
||||
- [web] show the "reply all" button in more situations
|
||||
|
||||
4.0.6 (2019-02-21)
|
||||
------------------
|
||||
|
|
|
@ -274,12 +274,22 @@
|
|||
* @returns true if the message is not a draft and has more than one recipient
|
||||
*/
|
||||
Message.prototype.allowReplyAll = function() {
|
||||
var identities = _.map(this.$mailbox.$account.identities, 'email');
|
||||
var recipientsCount = 0;
|
||||
recipientsCount = _.reduce(['to', 'cc', 'bcc'], _.bind(function(count, type) {
|
||||
if (this[type])
|
||||
return count + this[type].length;
|
||||
else
|
||||
recipientsCount = _.reduce(['to', 'cc', 'bcc', 'reply-to'], _.bind(function(count, type) {
|
||||
var typeCount = 0;
|
||||
if (this[type]) {
|
||||
typeCount = this[type].length;
|
||||
_.forEach(this[type], function(recipient) {
|
||||
if (_.indexOf(identities, recipient.email) >= 0) {
|
||||
typeCount--;
|
||||
}
|
||||
});
|
||||
return count + typeCount;
|
||||
}
|
||||
else {
|
||||
return count;
|
||||
}
|
||||
}, this), recipientsCount);
|
||||
|
||||
return !this.isDraft && recipientsCount > 1;
|
||||
|
|
Loading…
Reference in New Issue