Aleksander Machniak
2012-12-12 04689fa7ee89c29b57278a354b39d9ee5397a442
Fix so compacting of non-empty folder is possible also when messages list is empty (#1488858)
7 files modified
26 ■■■■■ changed files
CHANGELOG 1 ●●●● patch | view | raw | blame | history
program/js/app.js 11 ●●●● patch | view | raw | blame | history
program/steps/mail/check_recent.inc 4 ●●● patch | view | raw | blame | history
program/steps/mail/folders.inc 1 ●●●● patch | view | raw | blame | history
program/steps/mail/list.inc 1 ●●●● patch | view | raw | blame | history
program/steps/mail/move_del.inc 7 ●●●●● patch | view | raw | blame | history
program/steps/mail/search.inc 1 ●●●● patch | view | raw | blame | history
CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
- Fix so compacting of non-empty folder is possible also when messages list is empty (#1488858)
- Allow forwarding of multiple emails (#1486854)
- Fix big memory consumption of DB layer (#1488856)
- Add workaround for IE<=8 bug where Content-Disposition:inline was ignored (#1488844)
program/js/app.js
@@ -651,13 +651,13 @@
        break;
      case 'expunge':
        if (this.env.messagecount)
        if (this.env.exists)
          this.expunge_mailbox(this.env.mailbox);
        break;
      case 'purge':
      case 'empty-mailbox':
        if (this.env.messagecount)
        if (this.env.exists)
          this.purge_mailbox(this.env.mailbox);
        break;
@@ -2971,7 +2971,7 @@
  // test if purge command is allowed
  this.purge_mailbox_test = function()
  {
    return (this.env.messagecount && (this.env.mailbox == this.env.trash_mailbox || this.env.mailbox == this.env.junk_mailbox
    return (this.env.exists && (this.env.mailbox == this.env.trash_mailbox || this.env.mailbox == this.env.junk_mailbox
      || this.env.mailbox.match('^' + RegExp.escape(this.env.trash_mailbox) + RegExp.escape(this.env.delimiter))
      || this.env.mailbox.match('^' + RegExp.escape(this.env.junk_mailbox) + RegExp.escape(this.env.delimiter))));
  };
@@ -6228,7 +6228,7 @@
      case 'purge':
      case 'expunge':
        if (this.task == 'mail') {
          if (!this.env.messagecount) {
          if (!this.env.exists) {
            // clear preview pane content
            if (this.env.contentframe)
              this.show_contentframe(false);
@@ -6248,7 +6248,8 @@
        this.env.qsearch = null;
      case 'list':
        if (this.task == 'mail') {
          this.enable_command('show', 'expunge', 'select-all', 'select-none', (this.env.messagecount > 0));
          this.enable_command('show', 'select-all', 'select-none', this.env.messagecount > 0);
          this.enable_command('expunge', this.env.exists);
          this.enable_command('purge', this.purge_mailbox_test());
          this.enable_command('expand-all', 'expand-unread', 'collapse-all', this.env.threading && this.env.messagecount);
program/steps/mail/check_recent.inc
@@ -75,13 +75,15 @@
        if (!empty($_GET['_quota']))
            $OUTPUT->command('set_quota', rcmail_quota_content());
        $OUTPUT->set_env('exists', $RCMAIL->storage->count($mbox_name, 'EXISTS'));
        // "No-list" mode, don't get messages
        if (empty($_GET['_list']))
            continue;
        // get overall message count; allow caching because rcube_storage::folder_status() did a refresh
        $list_mode = $RCMAIL->storage->get_threading() ? 'THREADS' : 'ALL';
        $all_count = $RCMAIL->storage->count(null, $list_mode, false, false);
        $all_count = $RCMAIL->storage->count($mbox_name, $list_mode, false, false);
        $page      = $RCMAIL->storage->get_page();
        $page_size = $RCMAIL->storage->get_pagesize();
program/steps/mail/folders.inc
@@ -65,6 +65,7 @@
            if (!empty($_REQUEST['_reload'])) {
                $OUTPUT->set_env('messagecount', 0);
                $OUTPUT->set_env('pagecount', 0);
                $OUTPUT->set_env('exists', 0);
                $OUTPUT->command('message_list.clear');
                $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text(), $mbox);
                $OUTPUT->command('set_unread_count', $mbox, 0);
program/steps/mail/list.inc
@@ -95,6 +95,7 @@
$OUTPUT->set_env('pagecount', $pages);
$OUTPUT->set_env('threading', $threading);
$OUTPUT->set_env('current_page', $count ? $RCMAIL->storage->get_page() : 1);
$OUTPUT->set_env('exists', $RCMAIL->storage->count($mbox_name, 'EXISTS'));
$OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($count), $mbox_name);
$OUTPUT->command('set_mailboxname', rcmail_get_mailbox_name_text());
program/steps/mail/move_del.inc
@@ -38,7 +38,7 @@
    if (!$moved) {
        // send error message
        if ($_POST['_from'] != 'show')
        if ($_POST['_from'] != 'show')
            $OUTPUT->command('list_mailbox');
        rcmail_display_server_error('errormoving');
        $OUTPUT->send();
@@ -59,7 +59,7 @@
    if (!$del) {
        // send error message
        if ($_POST['_from'] != 'show')
        if ($_POST['_from'] != 'show')
            $OUTPUT->command('list_mailbox');
        rcmail_display_server_error('errordeleting');
        $OUTPUT->send();
@@ -111,6 +111,7 @@
  $OUTPUT->set_env('messagecount', $msg_count);
  $OUTPUT->set_env('current_page', $page);
  $OUTPUT->set_env('pagecount', $pages);
  $OUTPUT->set_env('exists', $RCMAIL->storage->count($mbox, 'EXISTS', true));
  // update mailboxlist
  $mbox = $RCMAIL->storage->get_folder();
@@ -144,5 +145,3 @@
// send response
$OUTPUT->send();
program/steps/mail/search.inc
@@ -143,5 +143,6 @@
$OUTPUT->set_env('search_request', $search_str ? $search_request : '');
$OUTPUT->set_env('messagecount', $count);
$OUTPUT->set_env('pagecount', ceil($count/$RCMAIL->storage->get_pagesize()));
$OUTPUT->set_env('exists', $RCMAIL->storage->count($mbox_name, 'EXISTS'));
$OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($count, 1), $mbox);
$OUTPUT->send();