do NOT update counter in Mail tab-header, eg. for Junk

This commit is contained in:
Ralf Becker 2020-08-06 13:00:35 +02:00
parent 2a948825d3
commit f860b3adf9

View File

@ -427,6 +427,8 @@ app.classes.mail = AppJS.extend(
// notify user a new mail arrived // notify user a new mail arrived
if (pushData.type === 'add') if (pushData.type === 'add')
{ {
// never notify for Trash, Junk, Drafts or Sent folder
if (pushData.acl.folder.match(/^(INBOX.)?(Trash|Spam|Junk|Drafts|Sent)$/)) return;
// increment notification counter on (closed) mail tab // increment notification counter on (closed) mail tab
let framework = egw_getFramework(); let framework = egw_getFramework();
if (framework) framework.notifyAppTab('mail'); if (framework) framework.notifyAppTab('mail');
@ -472,8 +474,6 @@ app.classes.mail = AppJS.extend(
{ {
let framework = egw_getFramework(); let framework = egw_getFramework();
let notify = this.egw.preference('new_mail_notification', 'mail'); let notify = this.egw.preference('new_mail_notification', 'mail');
// never notify for Trash, Junk or Drafts folder
if (pushData.acl.folder.match(/^(INBOX.)?(Trash|Spam|Junk|Drafts|Sent)$/)) return;
if (typeof notify === 'undefined' || notify === 'always' || if (typeof notify === 'undefined' || notify === 'always' ||
notify === 'not-mail' && framework && framework.activeApp.appName !== 'mail') notify === 'not-mail' && framework && framework.activeApp.appName !== 'mail')
{ {