mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-03 02:25:25 +00:00
(js) Show the reply-all btn in more situations
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user