From 1903025cc9e8f352f838acee6d5ab94f82374b8f Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Fri, 6 Oct 2017 17:38:26 +0200 Subject: [PATCH] Allow folder notification on INBOX only for popup_only chain --- admin/inc/class.admin_mail.inc.php | 5 +++++ mail/inc/class.mail_hooks.inc.php | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/admin/inc/class.admin_mail.inc.php b/admin/inc/class.admin_mail.inc.php index a7dc689085..4f47d7d9bd 100644 --- a/admin/inc/class.admin_mail.inc.php +++ b/admin/inc/class.admin_mail.inc.php @@ -1228,6 +1228,11 @@ class admin_mail $sel_options['acc_folder_junk'] = $sel_options['acc_folder_archive'] = $sel_options['notify_folders'] = $sel_options['acc_folder_ham'] = self::mailboxes(self::imap_client ($content)); + // Allow folder notification on INBOX for popup_only + if ($GLOBALS['egw_info']['user']['preferences']['notifications']['notification_chain'] == 'popup_only') + { + $sel_options['notify_folders']['INBOX'] = lang('INBOX'); + } } catch(Exception $e) { if (self::$debug) _egw_log_exception($e); diff --git a/mail/inc/class.mail_hooks.inc.php b/mail/inc/class.mail_hooks.inc.php index c98df2c572..a7d3d95a39 100644 --- a/mail/inc/class.mail_hooks.inc.php +++ b/mail/inc/class.mail_hooks.inc.php @@ -522,7 +522,10 @@ class mail_hooks $recent_messages = array(); $folder_status = array(); foreach($notify_folders as $id=>$notify_folder) { - if (empty($notify_folder)) continue; + // Allow folder notification on INBOX for popup_only chain + if (empty($notify_folder) || + ($notify_folder == 'INBOX' && + $GLOBALS['egw_info']['user']['preferences']['notifications']['notification_chain'] != 'popup_only')) continue; if(!is_array($notified_mail_uidsCache[$activeProfile][$notify_folder])) { $notified_mail_uidsCache[$activeProfile][$notify_folder] = array(); }