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