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/include/rcube_message.php |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/program/include/rcube_message.php b/program/include/rcube_message.php
index d05b57a..8c61a4d 100644
--- a/program/include/rcube_message.php
+++ b/program/include/rcube_message.php
@@ -76,10 +76,10 @@
     {
         $this->uid  = $uid;
         $this->app  = rcmail::get_instance();
-        $this->imap = $this->app->imap;
-        $this->imap->get_all_headers = true;
+        $this->storage = $this->app->get_storage();
+        $this->storage->set_options(array('all_headers' => true));
 
-        $this->headers = $this->imap->get_message($uid);
+        $this->headers = $this->storage->get_message($uid);
 
         if (!$this->headers)
             return;
@@ -94,7 +94,7 @@
             'safe' => $this->is_safe,
             'prefer_html' => $this->app->config->get('prefer_html'),
             'get_url' => rcmail_url('get', array(
-                '_mbox' => $this->imap->get_mailbox_name(), '_uid' => $uid))
+                '_mbox' => $this->storage->get_folder(), '_uid' => $uid))
         );
 
         if (!empty($this->headers->structure)) {
@@ -102,7 +102,7 @@
             $this->parse_structure($this->headers->structure);
         }
         else {
-            $this->body = $this->imap->get_body($uid);
+            $this->body = $this->storage->get_body($uid);
         }
 
         // notify plugins and let them analyze this structured message object
@@ -176,7 +176,7 @@
                 return $fp ? true : $part->body;
             }
             // get from IMAP
-            return $this->imap->get_message_part($this->uid, $mime_id, $part, NULL, $fp);
+            return $this->storage->get_message_part($this->uid, $mime_id, $part, NULL, $fp);
         } else
             return null;
     }
@@ -211,7 +211,7 @@
         foreach ($this->mime_parts as $mime_id => $part) {
             $mimetype = strtolower($part->ctype_primary . '/' . $part->ctype_secondary);
             if ($mimetype == 'text/html') {
-                return $this->imap->get_message_part($this->uid, $mime_id, $part);
+                return $this->storage->get_message_part($this->uid, $mime_id, $part);
             }
         }
     }
@@ -234,10 +234,10 @@
             $mimetype = $part->ctype_primary . '/' . $part->ctype_secondary;
 
             if ($mimetype == 'text/plain') {
-                return $this->imap->get_message_part($this->uid, $mime_id, $part);
+                return $this->storage->get_message_part($this->uid, $mime_id, $part);
             }
             else if ($mimetype == 'text/html') {
-                $out = $this->imap->get_message_part($this->uid, $mime_id, $part);
+                $out = $this->storage->get_message_part($this->uid, $mime_id, $part);
 
                 // remove special chars encoding
                 $trans = array_flip(get_html_translation_table(HTML_ENTITIES));
@@ -590,7 +590,7 @@
     {
         // @TODO: attachment may be huge, hadle it via file
         if (!isset($part->body))
-            $part->body = $this->imap->get_message_part($this->uid, $part->mime_id, $part);
+            $part->body = $this->storage->get_message_part($this->uid, $part->mime_id, $part);
 
         $parts = array();
         $tnef = new tnef_decoder;
@@ -626,7 +626,7 @@
     {
         // @TODO: messages may be huge, hadle body via file
         if (!isset($part->body))
-            $part->body = $this->imap->get_message_part($this->uid, $part->mime_id, $part);
+            $part->body = $this->storage->get_message_part($this->uid, $part->mime_id, $part);
 
         $parts = array();
         // FIXME: line length is max.65?

--
Gitblit v1.9.1