← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11904: fix bugs

 

------------------------------------------------------------
revno: 11904
committer: Lai <lai.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-09-04 15:29:08 +0700
message:
  fix bugs
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/DHISMessageAlertListener.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/DatabaseSupportedInternalMemoryMessageQueue.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/DefaultSmsSender.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-core/src/main/java/org/hisp/dhis/sms/DHISMessageAlertListener.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/DHISMessageAlertListener.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/DHISMessageAlertListener.java	2013-09-04 08:29:08 +0000
@@ -144,7 +144,6 @@
             {
                 throw new SMSParserException(
                     "No user associated with this phone number. Please contact your supervisor." );
-
             }
         }
     }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/DatabaseSupportedInternalMemoryMessageQueue.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/DatabaseSupportedInternalMemoryMessageQueue.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/DatabaseSupportedInternalMemoryMessageQueue.java	2013-09-04 08:29:08 +0000
@@ -34,6 +34,7 @@
 
 import org.hisp.dhis.sms.incoming.IncomingSms;
 import org.hisp.dhis.sms.incoming.IncomingSmsStore;
+import org.hisp.dhis.sms.incoming.SmsMessageStatus;
 
 public class DatabaseSupportedInternalMemoryMessageQueue
     implements MessageQueue
@@ -70,6 +71,7 @@
     public void remove( IncomingSms message )
     {
         message.setParsed( true );
+        message.setStatus( SmsMessageStatus.PROCESSED );
         smsStore.update( message );
         queue.remove( message );
     }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/DefaultSmsSender.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/DefaultSmsSender.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/DefaultSmsSender.java	2013-09-04 08:29:08 +0000
@@ -147,11 +147,21 @@
 
         if ( gatewayId != null && !gatewayId.trim().isEmpty() )
         {
-            for ( User user : users )
+            if ( forceSend )
             {
-                if ( currentUserService.getCurrentUser() != null )
+                for ( User user : users )
                 {
-                    if ( !currentUserService.getCurrentUser().equals( user ) )
+                    if ( currentUserService.getCurrentUser() != null )
+                    {
+                        if ( !currentUserService.getCurrentUser().equals( user ) )
+                        {
+                            if ( isQualifiedReceiver( user ) )
+                            {
+                                toSendList.add( user );
+                            }
+                        }
+                    }
+                    else if ( currentUserService.getCurrentUser() == null )
                     {
                         if ( isQualifiedReceiver( user ) )
                         {
@@ -159,14 +169,12 @@
                         }
                     }
                 }
-                else if ( currentUserService.getCurrentUser() == null )
-                {
-                    if ( isQualifiedReceiver( user ) )
-                    {
-                        toSendList.add( user );
-                    }
-                }
-            }
+            }
+            else
+            {
+                toSendList.addAll( users );
+            }
+            
 
             Set<String> phoneNumbers = null;