diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component
index 3f8ea4e..f233636 100644
--- a/.settings/org.eclipse.wst.common.component
+++ b/.settings/org.eclipse.wst.common.component
@@ -4,9 +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 726cd23..4308d86 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
@@ -642,7 +642,7 @@ 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, escapeHtml(commentText));
+ boolean result = nm.notifyOwnCommentReply(feedOwnerId, feedid, escapedCommentText);
_log.trace("Comment Notification to post owner added? " + result);
}
@@ -652,7 +652,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
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(), commentText, nm, feedOwnerId, favorites));
+ Thread commentsNotificationthread = new Thread(new CommentNotificationsThread(store, user.getUsername(), comment.getFeedid(), escapedCommentText, nm, feedOwnerId, favorites));
commentsNotificationthread.start();
//send the notification to the mentioned users, if any
diff --git a/src/main/java/org/gcube/portlets/user/newsfeed/server/Utils.java b/src/main/java/org/gcube/portlets/user/newsfeed/server/Utils.java
index 5a532c2..27d93fa 100644
--- a/src/main/java/org/gcube/portlets/user/newsfeed/server/Utils.java
+++ b/src/main/java/org/gcube/portlets/user/newsfeed/server/Utils.java
@@ -85,10 +85,10 @@ public class Utils {
*/
protected static List getHashTags(String postText) {
List hashtags = new ArrayList<>();
- Pattern MY_PATTERN = Pattern.compile("#(\\w+)");
+ Pattern MY_PATTERN = Pattern.compile("^#\\w+|\\s#\\w+");
Matcher matcher = MY_PATTERN.matcher(postText);
while (matcher.find()) {
- hashtags.add("#"+matcher.group(1));
+ hashtags.add("#"+matcher.group().replace(" ", "").replace("#", ""));
}
return hashtags;
}