svn commit: r778927 - /ofbiz/branches/release09.04/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r778927 - /ofbiz/branches/release09.04/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java

hansbak-2
Author: hansbak
Date: Tue May 26 23:32:12 2009
New Revision: 778927

URL: http://svn.apache.org/viewvc?rev=778927&view=rev
Log:
reverted a fix on a non installed enhancement r778288 as reported in the mailinglist by Joe E which caused the built to fail

Modified:
    ofbiz/branches/release09.04/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java

Modified: ofbiz/branches/release09.04/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java?rev=778927&r1=778926&r2=778927&view=diff
==============================================================================
--- ofbiz/branches/release09.04/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java (original)
+++ ofbiz/branches/release09.04/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java Tue May 26 23:32:12 2009
@@ -33,7 +33,6 @@
 import java.util.TreeSet;
 
 import javax.mail.Address;
-import javax.mail.BodyPart;
 import javax.mail.MessagingException;
 import javax.mail.Multipart;
 import javax.mail.Part;
@@ -522,9 +521,12 @@
             }
             if (!commEvents.isEmpty()) {
                 Debug.logInfo("Ignoring Duplicate Email: " + aboutThisEmail, module);
-                return ServiceUtil.returnSuccess(" Message Ignored: duplicate messageId");
+                return ServiceUtil.returnSuccess(" Message Ignored: deplicate messageId");
+            } else {
+                Debug.logInfo("Persisting New Email: " + aboutThisEmail, module);
             }
 
+
             // get the related partId's
             List toParties = buildListOfPartyInfoFromEmailAddresses(addressesTo, userLogin, dispatcher);
             List ccParties = buildListOfPartyInfoFromEmailAddresses(addressesCC, userLogin, dispatcher);
@@ -593,24 +595,6 @@
                 contentIndex = "";
                 commEventMap = addMessageBody(commEventMap, (Multipart) messageContent);
             }
-            
-            // select the plain text bodypart
-            String messageBody = null;
-            if (wrapper.getMainPartCount() > 1) {
-             for (int ind=0; ind < wrapper.getMainPartCount(); ind++) {
-             BodyPart p = wrapper.getPart(ind + "");
-             if (p.getContentType().toLowerCase().indexOf("text/plain") > -1) {
-             messageBody = (String) p.getContent();
-             }
-             }
-            }
-            
-            if (messageBody == null ) {
-             messageBody = wrapper.getMessageBody();
-            }
-                        
-            commEventMap.put("content", messageBody);
-            commEventMap.put("contentMimeTypeId", messageBodyContentType.toLowerCase());            
 
             // check for for a reply to communication event (using in-reply-to the parent messageID)
             String[] inReplyTo = message.getHeader("In-Reply-To");
@@ -709,7 +693,6 @@
 
             result = dispatcher.runSync("createCommunicationEvent", commEventMap);
             communicationEventId = (String)result.get("communicationEventId");
-            Debug.logInfo("Persisting New Email: " + aboutThisEmail + " into CommunicationEventId: " + communicationEventId, module);
 
             if (messageContent instanceof Multipart) {
                 Debug.logInfo("===message has attachments=====", module);