From: Michael M Slusarz Date: Thu, 13 Nov 2008 19:15:37 +0000 (-0700) Subject: Much better determination of "base" alternative part. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=864360b7946c136aaacb4acfa9ad616b25cee3e6;p=horde.git Much better determination of "base" alternative part. --- diff --git a/imp/lib/Mime/Viewer/alternative.php b/imp/lib/Mime/Viewer/alternative.php index bfba666b9..b5c048b7d 100644 --- a/imp/lib/Mime/Viewer/alternative.php +++ b/imp/lib/Mime/Viewer/alternative.php @@ -69,22 +69,14 @@ class IMP_Horde_Mime_Viewer_alternative extends Horde_Mime_Viewer_Driver return $ret; } - /* Get the list of IDs directly under the subpart. */ - reset($subparts); - next($subparts); - $id = key($subparts); - do { - $base_ids[strval($id)] = true; - $id = Horde_Mime::mimeIdArithmetic($id, 'next'); - } while (isset($subparts[$id])); - /* If the last viewable message exists in a subpart, back up to the * base multipart and display all viewable parts in that multipart. * Else, display the single part. */ end($display_ids); - $disp_id = key($display_ids); - while (!is_null($disp_id) && !isset($base_ids[$disp_id])) { - $disp_id = Horde_Mime::mimeIdArithmetic($disp_id, 'up'); + $curr_id = key($display_ids); + while (strcmp($base_id, $curr_id) !== 0) { + $disp_id = $curr_id; + $curr_id = Horde_Mime::mimeIdArithmetic($curr_id, 'up', array('norfc822' => true)); } /* Now grab all keys under this ID. */