diff options
Diffstat (limited to 'plugins/newmail_notifier/newmail_notifier.php')
| -rw-r--r-- | plugins/newmail_notifier/newmail_notifier.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/plugins/newmail_notifier/newmail_notifier.php b/plugins/newmail_notifier/newmail_notifier.php index 742fce83d..bd61e3692 100644 --- a/plugins/newmail_notifier/newmail_notifier.php +++ b/plugins/newmail_notifier/newmail_notifier.php @@ -132,10 +132,31 @@ class newmail_notifier extends rcube_plugin */ function notify($args) { + // Already notified or non-automatic check if ($this->notified || !empty($_GET['_refresh'])) { return $args; } + // Get folders to skip checking for + if (empty($this->exceptions)) { + $this->delimiter = $this->rc->storage->get_hierarchy_delimiter(); + foreach (array('drafts_mbox', 'sent_mbox') as $folder) { + $folder = $this->rc->config->get($folder); + if (strlen($folder) && $folder != 'INBOX') { + $this->exceptions[] = $folder; + } + } + } + + $mbox = $args['mailbox']; + + // Skip exception (sent/drafts) folders (and their subfolders) + foreach ($this->exceptions as $folder) { + if (strpos($mbox.$this->delimiter, $folder.$this->delimiter) === 0) { + return $args; + } + } + $this->notified = true; // Load configuration |
