Re-add emoticons.
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 21 Nov 2008 07:39:21 +0000 (00:39 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 21 Nov 2008 07:39:21 +0000 (00:39 -0700)
imp/lib/Mime/Viewer/html.php
imp/lib/Mime/Viewer/plain.php

index 8350ba7..7e90556 100644 (file)
@@ -222,13 +222,14 @@ class IMP_Horde_Mime_Viewer_html extends Horde_Mime_Viewer_html
                 );
 
                 $data = preg_replace_callback($this->_img_regex, array($this, '_blockImages'), $data);
-
-                // TODO
-                //$msg = '<span style="background:#fff;color:#000">' . nl2br($msg) . '</span><br />';
-                //$msg = '<span id="block-images">' . $msg . '</span>';
             }
         }
 
+        require_once 'Horde/Text/Filter.php';
+        if ($GLOBALS['prefs']->getValue('emoticons')) {
+            $data = Text_Filter::filter($data, array('emoticons'), array(array('emoticons' => true)));
+        }
+
         return array(
             'html' => $data,
             'status' => $cleanhtml['status']
index dadb613..7880a52 100644 (file)
@@ -93,6 +93,10 @@ class IMP_Horde_Mime_Viewer_plain extends Horde_Mime_Viewer_plain
             );
         }
 
+        if ($prefs->getValue('emoticons')) {
+            $filters['emoticons'] = array('entities' => true);
+        }
+
         // Run filters.
         $text = Text_Filter::filter($text, array_keys($filters), array_values($filters));