should not send notification if sender and receiver are the same

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerSocial@74109 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2013-04-26 11:08:59 +00:00
parent b0d7c8f89c
commit af449595a0
1 changed files with 38 additions and 33 deletions

View File

@ -57,6 +57,10 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
*/
private boolean saveNotification(Notification notification2Save) {
_log.trace("Trying to send notification to: " + notification2Save.getUserid() + " Type: " + notification2Save.getType());
if (notification2Save.getSenderid().compareTo(notification2Save.getUserid()) == 0) {
_log.trace("Sender and Receiver are the same " + notification2Save.getUserid() + " Notification Stopped");
return true; //I'm not sending notifications to the person who triggered it, pretend I sent it though
}
List<NotificationChannelType> channels = null;
try {
channels = getStoreInstance().getUserNotificationChannels(notification2Save.getUserid());
@ -79,6 +83,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
result = true;
}
return result;
}
/**
* return the url of the application if exists in the profile