summaryrefslogtreecommitdiff
path: root/program/steps/mail
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-12-07 10:37:04 +0100
committerAleksander Machniak <alec@alec.pl>2012-12-07 10:37:04 +0100
commit8b748de4ec5e48c7cc0e3f4942669c369710830e (patch)
treede057f3331911bbffebb3be6f8a6d7647e16214f /program/steps/mail
parent176172c850a6836a9804c24b29b8ada13040670b (diff)
Plugin API: add 'check_recent' hook with possibility to control folders list used on check-recent action
Diffstat (limited to 'program/steps/mail')
-rw-r--r--program/steps/mail/check_recent.inc9
1 files changed, 7 insertions, 2 deletions
diff --git a/program/steps/mail/check_recent.inc b/program/steps/mail/check_recent.inc
index 90d17c15b..61693b4ed 100644
--- a/program/steps/mail/check_recent.inc
+++ b/program/steps/mail/check_recent.inc
@@ -25,7 +25,7 @@ if (empty($_REQUEST['_folderlist']) && empty($_REQUEST['_list'])) {
return;
}
-$current = $RCMAIL->storage->get_folder();
+$current = $RCMAIL->storage->get_folder();
$check_all = $RCMAIL->action != 'refresh' || (bool)$RCMAIL->config->get('check_all_folders');
// list of folders to check
@@ -34,10 +34,15 @@ if ($check_all) {
}
else {
$a_mailboxes = (array) $current;
- if ($a_mailboxes[0] != 'INBOX')
+ if ($current != 'INBOX') {
$a_mailboxes[] = 'INBOX';
+ }
}
+// Control folders list from a plugin
+$plugin = $RCMAIL->plugins->exec_hook('check_recent', array('folders' => $a_mailboxes, 'all' => $check_all));
+$a_mailboxes = $plugin['folders'];
+
// check recent/unseen counts
foreach ($a_mailboxes as $mbox_name) {
$is_current = $mbox_name == $current;