From 3c037c035953a5d1b6a6a7f05cc9b81c0497b6f6 Mon Sep 17 00:00:00 2001 From: Massimiliano Assante Date: Wed, 18 Sep 2019 17:04:59 +0200 Subject: [PATCH] bugfix --- .../gcube/social_networking/socialutillibrary/Utils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/gcube/social_networking/socialutillibrary/Utils.java b/src/main/java/org/gcube/social_networking/socialutillibrary/Utils.java index bbb8dbc..34e763c 100644 --- a/src/main/java/org/gcube/social_networking/socialutillibrary/Utils.java +++ b/src/main/java/org/gcube/social_networking/socialutillibrary/Utils.java @@ -94,7 +94,7 @@ public class Utils { Pattern MY_PATTERN = Pattern.compile(MENTIONS_REGEX); Matcher matcher = MY_PATTERN.matcher(postText); while (matcher.find()) { - mentions.add(matcher.group()); + mentions.add(matcher.group().replace("@", "").trim()); } return mentions; } @@ -375,7 +375,7 @@ public class Utils { */ public static String convertMentionUsernamesAnchorHTML(String escapedPostText, ArrayList mentionedUsers) { - String pageToRedirectURL = ""; + String pageToRedirectURL = "profile"; String httpGETAttrName = ""; String httpGETAttrValue =""; @@ -384,7 +384,7 @@ public class Utils { +"?"+ new String(Base64.encodeBase64(httpGETAttrName.getBytes()))+"="+ new String(Base64.encodeBase64(httpGETAttrValue.getBytes()))+"\">"+tagged.getAlternativeName()+" "; - escapedPostText = escapedPostText.replace(tagged.getName(), taggedHTML); + escapedPostText = escapedPostText.replace("@"+tagged.getName(), taggedHTML); } return escapedPostText; }