Aleksander Machniak
2014-05-12 2b72ec46a761ded28c83ef2ac544c9406a874802
Bypass cache when counting EXISTS messages
3 files modified
8 ■■■■ changed files
program/steps/mail/check_recent.inc 4 ●●●● patch | view | raw | blame | history
program/steps/mail/list.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/move_del.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/check_recent.inc
@@ -85,7 +85,7 @@
            $OUTPUT->command('set_quota', $RCMAIL->quota_content());
        }
        $OUTPUT->set_env('exists', $RCMAIL->storage->count($mbox_name, 'EXISTS'));
        $OUTPUT->set_env('exists', $RCMAIL->storage->count($mbox_name, 'EXISTS', true));
        // "No-list" mode, don't get messages
        if (empty($_POST['_list'])) {
@@ -146,7 +146,7 @@
    // set trash folder state
    if ($mbox_name === $trash) {
        $OUTPUT->command('set_trash_count', $RCMAIL->storage->count($mbox_name, 'EXISTS'));
        $OUTPUT->command('set_trash_count', $RCMAIL->storage->count($mbox_name, 'EXISTS', true));
    }
}
program/steps/mail/list.inc
@@ -93,7 +93,7 @@
// update message count display
$pages  = ceil($count/$RCMAIL->storage->get_pagesize());
$exists = $RCMAIL->storage->count($mbox_name, 'EXISTS');
$exists = $RCMAIL->storage->count($mbox_name, 'EXISTS', true);
$OUTPUT->set_env('messagecount', $count);
$OUTPUT->set_env('pagecount', $pages);
program/steps/mail/move_del.inc
@@ -166,7 +166,7 @@
      $OUTPUT->command('set_trash_count', $exists);
  }
  else if ($target !== null && $target === $trash) {
      $OUTPUT->command('set_trash_count', $RCMAIL->storage->count($trash, 'EXISTS'));
      $OUTPUT->command('set_trash_count', $RCMAIL->storage->count($trash, 'EXISTS', true));
  }
}