diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-02-07 09:36:42 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-02-07 09:36:42 +0000 |
| commit | eb8a3d2f0ebd599b3b0103ce4793920035ce1cd9 (patch) | |
| tree | a3e378596f3d1e13b6c34fa813568719464f6c45 /plugins | |
| parent | d2669456ebea1697be1c0be2e0e6d67385f03c53 (diff) | |
- Don;t show notofications for drafts/sent folders (#1488341)
git-svn-id: https://svn.roundcube.net/trunk@5859 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/newmail_notifier/newmail_notifier.php | 21 | ||||
| -rw-r--r-- | plugins/newmail_notifier/package.xml | 5 |
2 files changed, 24 insertions, 2 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 diff --git a/plugins/newmail_notifier/package.xml b/plugins/newmail_notifier/package.xml index 5ec7dd8a8..d3de25fb3 100644 --- a/plugins/newmail_notifier/package.xml +++ b/plugins/newmail_notifier/package.xml @@ -19,9 +19,9 @@ <email>alec@alec.pl</email> <active>yes</active> </lead> - <date>2011-11-21</date> + <date>2012-02-07</date> <version> - <release>0.3</release> + <release>0.4</release> <api>0.3</api> </version> <stability> @@ -52,6 +52,7 @@ <file name="localization/pl_PL.inc" role="data"></file> <file name="localization/pt_BR.inc" role="data"></file> <file name="localization/ru_RU.inc" role="data"></file> + <file name="localization/sv_SE.inc" role="data"></file> </dir> <!-- / --> </contents> |
