← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11565: fix bugs for un-register command

 

------------------------------------------------------------
revno: 11565
committer: Lai <lai.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-08-05 11:27:21 +0700
message:
  fix bugs for un-register command
modified:
  dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/parse/DefaultParserManager.java


--
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-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/parse/DefaultParserManager.java'
--- dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/parse/DefaultParserManager.java	2013-08-01 07:38:07 +0000
+++ dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/parse/DefaultParserManager.java	2013-08-05 04:27:21 +0000
@@ -384,7 +384,12 @@
             Set<User> receivers = new HashSet<User>( userGroup.getMembers() );
 
             UserCredentials anonymousUser = userService.getUserCredentialsByUsername( ANONYMOUS_USER_NAME );
-
+            
+            if( anonymousUser == null)
+            {
+                anonymousUser = userService.getUserCredentialsByUsername( "admin" );
+            }
+            
             MessageConversation conversation = new MessageConversation( command.getName(), anonymousUser.getUser() );
 
             conversation.addMessage( new Message( message, null, anonymousUser.getUser() ) );
@@ -395,8 +400,10 @@
 
                 conversation.addUserMessage( new UserMessage( receiver, read ) );
             }
+            // forward to user group by SMS, E-mail, DHIS conversation
+            messageService.sendMessage( command.getName(), message, null, receivers, anonymousUser.getUser(), false, false );
             
-            messageConversationStore.save( conversation );
+            //messageConversationStore.save( conversation );
         }
     }