From 1c31ce4927c0af99f17f7936128a9ebeb7d0f563 Mon Sep 17 00:00:00 2001 From: Costantino Perciante Date: Wed, 17 Feb 2016 17:29:46 +0000 Subject: [PATCH] Update to support commentKey field when using notifications git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/news-feed@124275 82a268e6-3cf1-43bd-a215-b396298e98cf --- .settings/org.eclipse.wst.common.component | 6 ------ .../portlets/user/newsfeed/server/NewsServiceImpl.java | 8 ++++---- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index 7f23a73..7d33a49 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -4,12 +4,6 @@ - - uses - - - uses - diff --git a/src/main/java/org/gcube/portlets/user/newsfeed/server/NewsServiceImpl.java b/src/main/java/org/gcube/portlets/user/newsfeed/server/NewsServiceImpl.java index 723f455..93a2a8e 100644 --- a/src/main/java/org/gcube/portlets/user/newsfeed/server/NewsServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/newsfeed/server/NewsServiceImpl.java @@ -719,17 +719,17 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService //if the user who commented this post is not the user who posted it notify the poster user (Feed owner) NotificationsManager nm = new ApplicationNotificationsManager(getASLSession(), APP_ID); if (! user.getUsername().equals(feedOwnerId) && (!isAppFeed)) { - boolean result = nm.notifyOwnCommentReply(feedOwnerId, feedid, escapedCommentText); + boolean result = nm.notifyOwnCommentReply(feedOwnerId, feedid, escapedCommentText, comment.getKey()); _log.trace("Comment Notification to post owner added? " + result); } //if there are users who liked this post they get notified, asynchronously with this thread ArrayList favorites = getAllLikesByFeed(feedid); - Thread likesThread = new Thread(new LikeNotificationsThread(commentText, nm, favorites, feedOwnerId)); + Thread likesThread = new Thread(new LikeNotificationsThread(commentText, nm, favorites, feedOwnerId, comment.getKey())); likesThread.start(); //notify the other users who commented this post (excluding the ones above) - Thread commentsNotificationthread = new Thread(new CommentNotificationsThread(store, user.getUsername(), comment.getFeedid(), escapedCommentText, nm, feedOwnerId, favorites)); + Thread commentsNotificationthread = new Thread(new CommentNotificationsThread(store, user.getUsername(), comment.getFeedid(), escapedCommentText, nm, feedOwnerId, comment.getKey(), favorites)); commentsNotificationthread.start(); //send the notification to the mentioned users, if any @@ -738,7 +738,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService for (ItemBean u : mentionedUsers) { toPass.add(new GenericItemBean(u.getId(), u.getName(), u.getAlternativeName(), u.getThumbnailURL())); } - Thread thread = new Thread(new MentionNotificationsThread(comment.getFeedid(), commentText, nm, toPass)); + Thread thread = new Thread(new MentionNotificationsThread(comment.getFeedid(), commentText, nm, comment.getKey(), toPass)); thread.start(); } }