-$cc = decodeHeader(getLineOfAddrs($message->header->cc));
-$to = decodeHeader(getLineOfAddrs($message->header->to));
-
-/* and Body and Subject could easily stream off the page... */
-$id = $message->header->id;
-$ent_ar = findDisplayEntity ($message, 0);
-$ent_num = $ent_ar[0];
-
-$body_message = getEntity($message, $ent_num);
-if (($body_message->header->type0 == 'text') ||
- ($body_message->header->type0 == 'rfc822')) {
- $body = mime_fetch_body ($imap_stream, $id, $ent_num);
- $body = decodeBody($body, $body_message->header->encoding);
- $hookResults = do_hook('message_body', $body);
- $body = $hookResults[1];
- if ($body_message->header->type1 == 'html') {
- if( $show_html_default <> 1 ) {
- $body = strip_tags( $body );
- translateText($body, $wrap_at, $body_message->header->charset);
- } else {
- $body = MagicHTML( $body, $id, $message );
- }
- } else {
- translateText($body, $wrap_at, $body_message->header->charset);
- }
+$cc = $rfc822_header->getAddr_s('cc');
+$to = $rfc822_header->getAddr_s('to');
+
+if ($show_html_default == 1) {
+ $ent_ar = $message->findDisplayEntity(array());