No need for SessionObjects; fix display of body parts.
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 20 Nov 2008 19:44:38 +0000 (12:44 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 20 Nov 2008 19:44:38 +0000 (12:44 -0700)
imp/mailbox.php
imp/thread.php

index 3a45048..5a267f6 100644 (file)
@@ -188,8 +188,7 @@ case 'empty_mailbox':
     break;
 
 case 'view_messages':
-    $cacheSess = &Horde_SessionObjects::singleton();
-    $redirect = Util::addParameter(IMP::generateIMPUrl('thread.php', $imp_mbox['mailbox'], null, null, false), array('mode' => 'msgview', 'msglist' => $cacheSess->storeOid($indices)), null, false);
+    $redirect = Util::addParameter(IMP::generateIMPUrl('thread.php', $imp_mbox['mailbox'], null, null, false), array('mode' => 'msgview', 'msglist' => IMP::toRangeString(IMP::parseIndicesList($indices))), null, false);
     header('Location: ' . $redirect);
     exit;
 
index 3f1247b..ab26626 100644 (file)
@@ -27,15 +27,8 @@ if ($mode == 'thread') {
     }
 } else {
     /* MSGVIEW MODE: Make sure we have a valid list of messages. */
-    $cacheID = Util::getFormData('msglist');
-    if (!$cacheID) {
-        $error = true;
-    }
-    $cacheSess = &Horde_SessionObjects::singleton();
-    $msglist = $cacheSess->query($cacheID);
-    if ($msglist) {
-        $cacheSess->setPruneFlag($cacheID, true);
-    } else {
+    $msglist = IMP::parseRangeString(Util::getFormData('msglist', array()));
+    if (empty($msglist)) {
         $error = true;
     }
 }
@@ -98,7 +91,9 @@ foreach ($loop_array as $mbox => $idxlist) {
         $contents = &IMP_Contents::singleton($idx . IMP::IDX_SEP . $mbox);
         $mime_id = $contents->findBody();
         if ($contents->canDisplay($mime_id, IMP_Contents::RENDER_INLINE)) {
-            $curr_msg['body'] = $contents->renderMIMEPart($mime_id, IMP_Contents::RENDER_INLINE);
+            $ret = $contents->renderMIMEPart($mime_id, IMP_Contents::RENDER_INLINE);
+            $ret = reset($ret);
+            $curr_msg['body'] = $ret['data'];
         } else {
             $curr_msg['body'] = '<em>' . _("There is no text that can be displayed inline.") . '</em>';
         }