← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5715: (mobile) minor message fixes

 

------------------------------------------------------------
revno: 5715
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-01-12 14:13:22 +0530
message:
  (mobile) minor message fixes
modified:
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/message/action/GetMessageAction.java
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/message/action/SendReplyAction.java
  dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/message/action/GetMessageAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/message/action/GetMessageAction.java	2012-01-09 14:29:43 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/message/action/GetMessageAction.java	2012-01-12 08:43:22 +0000
@@ -31,6 +31,8 @@
 import org.hisp.dhis.message.Message;
 import org.hisp.dhis.message.MessageConversation;
 import org.hisp.dhis.message.MessageService;
+import org.hisp.dhis.user.CurrentUserService;
+import org.springframework.util.Assert;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -53,6 +55,13 @@
         this.messageService = messageService;
     }
 
+    private CurrentUserService currentUserService;
+
+    public void setCurrentUserService( CurrentUserService currentUserService )
+    {
+        this.currentUserService = currentUserService;
+    }
+
     // -------------------------------------------------------------------------
     // Input & Output
     // -------------------------------------------------------------------------
@@ -90,12 +99,17 @@
     @Override
     public String execute() throws Exception
     {
+        Assert.hasText( conversationId );
+
         MessageConversation conversation = messageService.getMessageConversation( conversationId );
 
         subject = conversation.getSubject();
         messages = new ArrayList<Message>( conversation.getMessages() );
         Collections.reverse( messages );
 
+        conversation.markRead( currentUserService.getCurrentUser() );
+        messageService.updateMessageConversation( conversation );
+
         return SUCCESS;
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/message/action/SendReplyAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/message/action/SendReplyAction.java	2012-01-09 14:29:43 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/message/action/SendReplyAction.java	2012-01-12 08:43:22 +0000
@@ -32,6 +32,7 @@
 import org.hisp.dhis.message.MessageConversation;
 import org.hisp.dhis.message.MessageService;
 import org.hisp.dhis.util.ContextUtils;
+import org.springframework.util.Assert;
 
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
@@ -75,6 +76,8 @@
     @Override
     public String execute() throws Exception
     {
+        Assert.hasText( text );
+
         String metaData = MessageService.META_USER_AGENT +
             ServletActionContext.getRequest().getHeader( ContextUtils.HEADER_USER_AGENT );
 

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml	2012-01-09 14:29:43 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml	2012-01-12 08:43:22 +0000
@@ -134,6 +134,7 @@
 
   <bean id="org.hisp.dhis.light.message.action.GetMessageAction" class="org.hisp.dhis.light.message.action.GetMessageAction">
     <property name="messageService" ref="org.hisp.dhis.message.MessageService" />
+    <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
   </bean>
 
   <bean id="org.hisp.dhis.light.message.action.SendReplyAction" class="org.hisp.dhis.light.message.action.SendReplyAction">

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties	2012-01-12 07:01:26 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties	2012-01-12 08:43:22 +0000
@@ -48,4 +48,4 @@
 write_feedback=Write feedback
 successfully_marked_as_complete=Successfully marked as complete
 successfully_marked_as_not_complete=Successfully marked as not complete
-successfully_saved_section=Successfully saved section
+successfully_saved_section=Successfully saved