Author: norman
Date: Mon Aug 17 10:43:02 2009
New Revision: 804931

URL: http://svn.apache.org/viewvc?rev=804931&view=rev
Log:
Correctly fill email text for non multipart emails

Modified:
    
labs/hupa/src/main/java/org/apache/hupa/server/handler/ExposeMessageHandler.java

Modified: 
labs/hupa/src/main/java/org/apache/hupa/server/handler/ExposeMessageHandler.java
URL: 
http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/server/handler/ExposeMessageHandler.java?rev=804931&r1=804930&r2=804931&view=diff
==============================================================================
--- 
labs/hupa/src/main/java/org/apache/hupa/server/handler/ExposeMessageHandler.java
 (original)
+++ 
labs/hupa/src/main/java/org/apache/hupa/server/handler/ExposeMessageHandler.java
 Mon Aug 17 10:43:02 2009
@@ -87,9 +87,14 @@
             Object con = message.getContent();
 
             if (con instanceof String) {
-                //content.setText(StringEscapeUtils.escapeHtml((String) 
con).replaceAll("\n", "<br>"));
-                content.setIsHTML(isHTML);
+               if (message.getContentType().startsWith("text/html")) {
+                       isHTML = true;
+               } else {
+                       isHTML = false;
+               }
                 bodyFound = true;
+                content.setText((String)con);
+                content.setIsHTML(isHTML);   
 
             } else if (con instanceof Multipart) {
                 Multipart mp = (Multipart) con;
@@ -108,9 +113,11 @@
                        bodyFound = true;
                     } else if (bodyFound == false && 
contentType.startsWith("text/html")) {
                         isHTML = true;
+                        /*
                         if (sbHTML.length() > 0) {
                             sbHTML.append("<HR/>");
                         }
+                        */
                         bodyFound = true;
                         sbHTML.append((String) part.getContent());
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to