Author: dongxu Date: Thu Sep 12 02:00:55 2013 New Revision: 1522103 URL: http://svn.apache.org/r1522103 Log: constantly changed by manolo
Modified: james/hupa/trunk/client/pom.xml james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainView.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendPresenter.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendView.java james/hupa/trunk/pom.xml james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractFetchMessagesHandler.java james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/FetchMessagesHandlerTest.java Modified: james/hupa/trunk/client/pom.xml URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/pom.xml?rev=1522103&r1=1522102&r2=1522103&view=diff ============================================================================== --- james/hupa/trunk/client/pom.xml (original) +++ james/hupa/trunk/client/pom.xml Thu Sep 12 02:00:55 2013 @@ -39,6 +39,10 @@ </dependency> <dependency> <groupId>org.apache.hupa</groupId> + <artifactId>hupa-mock</artifactId> + </dependency> + <dependency> + <groupId>org.apache.hupa</groupId> <artifactId>hupa-shared</artifactId> </dependency> <dependency> @@ -300,19 +304,4 @@ </plugin> </plugins> </build> - <profiles> - <profile> - <id>prod</id> - <properties> - <gwt.moduleSuffix>Prod</gwt.moduleSuffix> - <gwt.disableClassMetadata>true</gwt.disableClassMetadata> - <gwt.disableCastChecking>true</gwt.disableCastChecking> - <gwt.logLevel>TRACE</gwt.logLevel> - </properties> - </profile> - </profiles> - <properties> - <gwt.moduleSuffix></gwt.moduleSuffix> - <gwt.logLevel>ERROR</gwt.logLevel> - </properties> </project> Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainView.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainView.java?rev=1522103&r1=1522102&r2=1522103&view=diff ============================================================================== --- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainView.java (original) +++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainView.java Thu Sep 12 02:00:55 2013 @@ -117,6 +117,7 @@ public class MainView extends Composite // Not used so far // createNorth(); // dockPanel.add(north, DockPanel.NORTH); + // dockPanel.setCellHorizontalAlignment(north, DockPanel.ALIGN_RIGHT); createWest(); dockPanel.add(west, DockPanel.WEST); @@ -124,7 +125,6 @@ public class MainView extends Composite createCenter(); dockPanel.add(center, DockPanel.CENTER); - dockPanel.setCellHorizontalAlignment(north, DockPanel.ALIGN_RIGHT); dockPanel.setCellHorizontalAlignment(center, DockPanel.ALIGN_LEFT); initWidget(dockPanel); Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendPresenter.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendPresenter.java?rev=1522103&r1=1522102&r2=1522103&view=diff ============================================================================== --- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendPresenter.java (original) +++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendPresenter.java Thu Sep 12 02:00:55 2013 @@ -294,13 +294,17 @@ public class MessageSendPresenter extend if (type.equals(Type.NEW) && mailto != null) { display.getToText().setText(mailto); } else if (type.equals(Type.FORWARD)) { - if (oldmessage.getSubject() != null && !oldmessage.getSubject().toLowerCase().startsWith("fwd:")) { - display.getSubjectText().setText("Fwd: " + oldmessage.getSubject()); - } + String subject = oldmessage.getSubject() != null ? oldmessage.getSubject().trim() : ""; + if (!subject.toLowerCase().startsWith("fwd:")){ + subject = "Fwd: " + subject; + } + display.getSubjectText().setText(subject); } else if (type.equals(Type.REPLY) || type.equals(Type.REPLY_ALL)) { - if (oldmessage.getSubject() != null && !oldmessage.getSubject().toLowerCase().startsWith("re:")) { - display.getSubjectText().setText("Re: " + oldmessage.getSubject()); - } + String subject = oldmessage.getSubject() != null ? oldmessage.getSubject().trim() : ""; + if (!subject.toLowerCase().startsWith("re:")){ + subject = "Re: " + subject; + } + display.getSubjectText().setText(subject); if (type.equals(Type.REPLY)) { if (oldmessage.getReplyto() != null && !oldmessage.getFrom().contains(oldmessage.getReplyto())) { display.getToText().setText(oldmessage.getReplyto()); Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendView.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendView.java?rev=1522103&r1=1522102&r2=1522103&view=diff ============================================================================== --- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendView.java (original) +++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendView.java Thu Sep 12 02:00:55 2013 @@ -130,9 +130,6 @@ public class MessageSendView extends Com new EmailListValidator(getToText()).addActionForFailure(sAction).addActionForFailure(fAction), new NotEmptyValidator(getToText()).addActionForFailure(sAction).addActionForFailure(fAction)); - try { - } catch (Exception e) { - } } /* Modified: james/hupa/trunk/pom.xml URL: http://svn.apache.org/viewvc/james/hupa/trunk/pom.xml?rev=1522103&r1=1522102&r2=1522103&view=diff ============================================================================== --- james/hupa/trunk/pom.xml (original) +++ james/hupa/trunk/pom.xml Thu Sep 12 02:00:55 2013 @@ -137,14 +137,39 @@ ======= <gwtVersion>2.4.0</gwtVersion> <gwtMavenVersion>2.4.0</gwtMavenVersion> + <gwt.moduleSuffix></gwt.moduleSuffix> + <gwt.logLevel>ERROR</gwt.logLevel> <jettyVersion>7.3.0.v20110203</jettyVersion> + <mock.scope>test</mock.scope> </properties> + + <profiles> + <profile> + <!-- Agressive js compression. Compile for all browsers and languages --> + <id>prod</id> + <properties> + <gwt.moduleSuffix>Prod</gwt.moduleSuffix> + <gwt.disableClassMetadata>true</gwt.disableClassMetadata> + <gwt.disableCastChecking>true</gwt.disableCastChecking> + <gwt.logLevel>TRACE</gwt.logLevel> + </properties> + </profile> + <profile> + <!-- Deliver Hupa with Demo stuff --> + <id>demo</id> + <properties> + <mock.scope></mock.scope> + </properties> + </profile> + </profiles> + <dependencyManagement> <dependencies> <dependency> <groupId>org.apache.hupa</groupId> <artifactId>hupa-mock</artifactId> <version>${project.version}</version> + <scope>${mock.scope}</scope> </dependency> <dependency> <groupId>org.apache.hupa</groupId> Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractFetchMessagesHandler.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractFetchMessagesHandler.java?rev=1522103&r1=1522102&r2=1522103&view=diff ============================================================================== --- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractFetchMessagesHandler.java (original) +++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractFetchMessagesHandler.java Thu Sep 12 02:00:55 2013 @@ -259,7 +259,7 @@ public abstract class AbstractFetchMessa logger.debug("Unable to decode text " + s + " " + e.getMessage()); } // Remove quotes around names in email addresses - ret = ret.replaceFirst("^[\"' ]+(.*?)[\"' ]+<", "$1 <"); + ret = ret.replaceFirst("^[\"' ]+([^\"]*)[\"' ]+<", "$1 <"); return ret; } } Modified: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/FetchMessagesHandlerTest.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/FetchMessagesHandlerTest.java?rev=1522103&r1=1522102&r2=1522103&view=diff ============================================================================== --- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/FetchMessagesHandlerTest.java (original) +++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/FetchMessagesHandlerTest.java Thu Sep 12 02:00:55 2013 @@ -40,7 +40,7 @@ public class FetchMessagesHandlerTest ex MockIMAPFolder f = (MockIMAPFolder)store.getFolder("WHATEVER"); f.create(Folder.HOLDS_MESSAGES); - ByteArrayInputStream is = new ByteArrayInputStream("From: \"a...@foo.com\" <a...@foo.com>\nTo: b...@foo.com\nSubject: something\n\ndata".getBytes()); + ByteArrayInputStream is = new ByteArrayInputStream("From: \"a b c\"<a...@foo.com>\nTo: b...@foo.com\nSubject: something\n\ndata".getBytes()); MimeMessage m1 = new MimeMessage(session, is); is = new ByteArrayInputStream("From: \"=?ISO-8859-1?Q?Manolo_Pe=F1a?=\" <pe...@foo.com>\nTo: b...@foo.com\nSubject: something\n\ndata".getBytes()); MimeMessage m2 = new MimeMessage(session, is); @@ -54,7 +54,7 @@ public class FetchMessagesHandlerTest ex assertEquals(3, msgs.size()); msgs = fetchMessagesHandler.convert(10, f, new Message[]{m1}); - assertEquals("a...@foo.com <a...@foo.com>", msgs.get(0).getFrom()); + assertEquals("a b c <a...@foo.com>", msgs.get(0).getFrom()); msgs = fetchMessagesHandler.convert(10, f, new Message[]{m2}); assertEquals("Manolo Pe\u00F1a <pe...@foo.com>", msgs.get(0).getFrom()); --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org