|
|
|
@ -27,6 +27,7 @@ import org.gcube.applicationsupportlayer.social.ApplicationNotificationsManager;
|
|
|
|
|
import org.gcube.applicationsupportlayer.social.NotificationsManager;
|
|
|
|
|
import org.gcube.applicationsupportlayer.social.mailing.AppType;
|
|
|
|
|
import org.gcube.applicationsupportlayer.social.mailing.EmailPlugin;
|
|
|
|
|
import org.gcube.applicationsupportlayer.social.shared.SocialNetworkingUser;
|
|
|
|
|
import org.gcube.common.homelibrary.home.HomeLibrary;
|
|
|
|
|
import org.gcube.common.homelibrary.home.exceptions.HomeNotFoundException;
|
|
|
|
|
import org.gcube.common.homelibrary.home.exceptions.InternalErrorException;
|
|
|
|
@ -265,7 +266,11 @@ public class PeriodicTask implements Runnable {
|
|
|
|
|
if (newMessageId != null) {
|
|
|
|
|
_log.debug("Sending message notifications ... ");
|
|
|
|
|
List<GenericItemBean> recipients = getUsersbyUserId(recipientIds);
|
|
|
|
|
NotificationsManager nm = new ApplicationNotificationsManager(fakeSession);
|
|
|
|
|
|
|
|
|
|
NotificationsManager nm = new ApplicationNotificationsManager(
|
|
|
|
|
fakeSession.getScope(),
|
|
|
|
|
new SocialNetworkingUser(fakeSession.getUsername(), fakeSession.getUserEmailAddress(), fakeSession.getUserFullName(), fakeSession.getUserAvatarId())
|
|
|
|
|
);
|
|
|
|
|
Thread thread = new Thread(new MessageNotificationsThread(recipients, newMessageId, subject, messageText, nm));
|
|
|
|
|
thread.start();
|
|
|
|
|
} else {
|
|
|
|
@ -371,7 +376,10 @@ public class PeriodicTask implements Runnable {
|
|
|
|
|
String feedOwnerId = feed.getEntityId();
|
|
|
|
|
boolean isAppFeed = feed.isApplicationFeed();
|
|
|
|
|
|
|
|
|
|
NotificationsManager nm = new ApplicationNotificationsManager(fakeSession);
|
|
|
|
|
NotificationsManager nm = new ApplicationNotificationsManager(
|
|
|
|
|
fakeSession.getScope(),
|
|
|
|
|
new SocialNetworkingUser(fakeSession.getUsername(), fakeSession.getUserEmailAddress(), fakeSession.getUserFullName(), fakeSession.getUserAvatarId())
|
|
|
|
|
);
|
|
|
|
|
if (! fakeSession.getUsername().equals(feedOwnerId) && (!isAppFeed)) {
|
|
|
|
|
boolean result = nm.notifyLikedFeed(feedOwnerId, feedId, "");
|
|
|
|
|
_log.trace("Like Notification to post owner added? " + result);
|
|
|
|
@ -398,7 +406,10 @@ public class PeriodicTask implements Runnable {
|
|
|
|
|
boolean isAppFeed = feed.isApplicationFeed();
|
|
|
|
|
|
|
|
|
|
//if the user who commented this post is not the user who posted it notifies the poster user (Feed owner)
|
|
|
|
|
NotificationsManager nm = new ApplicationNotificationsManager(fakeSession);
|
|
|
|
|
NotificationsManager nm = new ApplicationNotificationsManager(
|
|
|
|
|
fakeSession.getScope(),
|
|
|
|
|
new SocialNetworkingUser(fakeSession.getUsername(), fakeSession.getUserEmailAddress(), fakeSession.getUserFullName(), fakeSession.getUserAvatarId())
|
|
|
|
|
);
|
|
|
|
|
if (! fakeSession.getUsername().equals(feedOwnerId) && (!isAppFeed)) {
|
|
|
|
|
boolean result = nm.notifyOwnCommentReply(feedOwnerId, feedId, commentText, comment.getKey());
|
|
|
|
|
_log.trace("Comment Notification to post owner added? " + result);
|
|
|
|
|