dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #21006
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9836: (mobile) - Force in sending SMS whether notification setting checked or not.
------------------------------------------------------------
revno: 9836
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-02-19 15:45:49 +0700
message:
(mobile) - Force in sending SMS whether notification setting checked or not.
modified:
dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/SmsMessageSender.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/outbound/SmsMessageSender.java'
--- dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/SmsMessageSender.java 2013-01-22 08:31:21 +0000
+++ dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/SmsMessageSender.java 2013-02-19 08:45:49 +0000
@@ -94,7 +94,7 @@
}
else
{
- phones = getRecipients( (Set<User>) recipients );
+ phones = getRecipientsWithoutNotification( (Set<User>) recipients );
}
if ( !phones.isEmpty() && phones.size() > 0 )
@@ -130,6 +130,23 @@
return recipients;
}
+ private Set<String> getRecipientsWithoutNotification( Set<User> users )
+ {
+ Set<String> recipients = new HashSet<String>();
+
+ for ( User user : users )
+ {
+ String phoneNumber = user.getPhoneNumber();
+
+ if ( phoneNumber != null && !phoneNumber.trim().isEmpty() )
+ {
+ recipients.add( phoneNumber );
+ }
+ }
+
+ return recipients;
+ }
+
private String createMessage( String subject, String text, User sender )
{
String name = "unknown";