From c321a955a7b0f6d6b13ffaebf040a6c7091037ae Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Mon, 16 Jan 2012 10:14:41 -0500
Subject: [PATCH] Merged devel-framework branch (r5746:5779) back into trunk

---
 program/steps/mail/list.inc |   23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/program/steps/mail/list.inc b/program/steps/mail/list.inc
index c2a4748..8bfb4c8 100644
--- a/program/steps/mail/list.inc
+++ b/program/steps/mail/list.inc
@@ -51,30 +51,31 @@
 if ($save_arr)
   $RCMAIL->user->save_prefs($save_arr);
 
-$mbox_name = $RCMAIL->imap->get_mailbox_name();
+$mbox_name = $RCMAIL->storage->get_folder();
+$threading = (bool) $RCMAIL->storage->get_threading();
 
 // Synchronize mailbox cache, handle flag changes
-$RCMAIL->imap->mailbox_sync($mbox_name);
+$RCMAIL->storage->folder_sync($mbox_name);
 
 // initialize searching result if search_filter is used
 if ($_SESSION['search_filter'] && $_SESSION['search_filter'] != 'ALL')
 {
   $search_request = md5($mbox_name.$_SESSION['search_filter']);
-  $RCMAIL->imap->search($mbox_name, $_SESSION['search_filter'], RCMAIL_CHARSET, $sort_col);
-  $_SESSION['search'] = $RCMAIL->imap->get_search_set();
+  $RCMAIL->storage->search($mbox_name, $_SESSION['search_filter'], RCMAIL_CHARSET, $sort_col);
+  $_SESSION['search'] = $RCMAIL->storage->get_search_set();
   $_SESSION['search_request'] = $search_request;
   $OUTPUT->set_env('search_request', $search_request);
 }
 
 // fetch message headers
-if ($count = $RCMAIL->imap->messagecount($mbox_name, $RCMAIL->imap->threading ? 'THREADS' : 'ALL', !empty($_REQUEST['_refresh'])))
-  $a_headers = $RCMAIL->imap->list_headers($mbox_name, NULL, $sort_col, $sort_order);
+if ($count = $RCMAIL->storage->count($mbox_name, $threading ? 'THREADS' : 'ALL', !empty($_REQUEST['_refresh'])))
+  $a_headers = $RCMAIL->storage->list_messages($mbox_name, NULL, $sort_col, $sort_order);
 
 // update search set (possible change of threading mode)
 if (!empty($_REQUEST['_search']) && isset($_SESSION['search'])
     && $_SESSION['search_request'] == $_REQUEST['_search']
 ) {
-  $_SESSION['search'] = $RCMAIL->imap->get_search_set();
+  $_SESSION['search'] = $RCMAIL->storage->get_search_set();
 }
 // remove old search data
 else if (empty($_REQUEST['_search']) && isset($_SESSION['search'])) {
@@ -91,11 +92,11 @@
 rcmail_send_unread_count($mbox_name, !empty($_REQUEST['_refresh']), $unseen);
 
 // update message count display
-$pages = ceil($count/$RCMAIL->imap->page_size);
+$pages = ceil($count/$RCMAIL->storage->get_pagesize());
 $OUTPUT->set_env('messagecount', $count);
 $OUTPUT->set_env('pagecount', $pages);
-$OUTPUT->set_env('threading', (bool) $RCMAIL->imap->threading);
-$OUTPUT->set_env('current_page', $count ? $RCMAIL->imap->list_page : 1);
+$OUTPUT->set_env('threading', $threading);
+$OUTPUT->set_env('current_page', $count ? $RCMAIL->storage->get_page() : 1);
 $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($count), $mbox_name);
 $OUTPUT->command('set_mailboxname', rcmail_get_mailbox_name_text());
 
@@ -108,7 +109,7 @@
 }
 else {
   // handle IMAP errors (e.g. #1486905)
-  if ($err_code = $RCMAIL->imap->get_error_code()) {
+  if ($err_code = $RCMAIL->storage->get_error_code()) {
     rcmail_display_server_error();
   }
   else if ($search_request)

--
Gitblit v1.9.1