dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #19312
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8364: Minor
------------------------------------------------------------
revno: 8364
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-10-03 16:29:10 +0200
message:
Minor
modified:
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/message/action/SendMessageAction.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-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/message/action/SendMessageAction.java'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/message/action/SendMessageAction.java 2012-09-24 06:28:31 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/message/action/SendMessageAction.java 2012-10-03 14:29:10 +0000
@@ -48,6 +48,9 @@
public class SendMessageAction
implements Action
{
+ private static final String PREFIX_USER = "u:";
+ private static final String PREFIX_USERGROUP = "ug:";
+
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
@@ -117,20 +120,20 @@
for ( String recipient : recipients )
{
- if ( recipient.startsWith( "u:" ) )
+ if ( recipient.startsWith( PREFIX_USER ) )
{
User user = userService.getUser( recipient.substring( 2 ) );
- if(user != null)
+ if ( user != null )
{
users.add( user );
}
}
- else if ( recipient.startsWith( "ug:" ) )
+ else if ( recipient.startsWith( PREFIX_USERGROUP ) )
{
UserGroup userGroup = userGroupService.getUserGroup( recipient.substring( 3 ) );
- if(userGroup != null)
+ if ( userGroup != null )
{
users.addAll( userGroup.getMembers() );
}