git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/news-feed@119826 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2015-10-16 10:27:47 +00:00
parent 484c6182ba
commit bf808987cb
3 changed files with 4 additions and 7 deletions

View File

@ -4,9 +4,6 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/> <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
<dependent-module archiveName="session-checker-0.4.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/session-checker/session-checker">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="pickitem-widget-1.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/pickitem-widget/pickitem-widget"> <dependent-module archiveName="pickitem-widget-1.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/pickitem-widget/pickitem-widget">
<dependency-type>uses</dependency-type> <dependency-type>uses</dependency-type>
</dependent-module> </dependent-module>

View File

@ -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) //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); NotificationsManager nm = new ApplicationNotificationsManager(getASLSession(), APP_ID);
if (! user.getUsername().equals(feedOwnerId) && (!isAppFeed)) { 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); _log.trace("Comment Notification to post owner added? " + result);
} }
@ -652,7 +652,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
likesThread.start(); likesThread.start();
//notify the other users who commented this post (excluding the ones above) //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(); commentsNotificationthread.start();
//send the notification to the mentioned users, if any //send the notification to the mentioned users, if any

View File

@ -85,10 +85,10 @@ public class Utils {
*/ */
protected static List<String> getHashTags(String postText) { protected static List<String> getHashTags(String postText) {
List<String> hashtags = new ArrayList<>(); List<String> hashtags = new ArrayList<>();
Pattern MY_PATTERN = Pattern.compile("#(\\w+)"); Pattern MY_PATTERN = Pattern.compile("^#\\w+|\\s#\\w+");
Matcher matcher = MY_PATTERN.matcher(postText); Matcher matcher = MY_PATTERN.matcher(postText);
while (matcher.find()) { while (matcher.find()) {
hashtags.add("#"+matcher.group(1)); hashtags.add("#"+matcher.group().replace(" ", "").replace("#", ""));
} }
return hashtags; return hashtags;
} }