diff --git a/src/org/thoughtcrime/securesms/conversation/ConversationActivity.java b/src/org/thoughtcrime/securesms/conversation/ConversationActivity.java index 5da03063cf..9dc5c1320b 100644 --- a/src/org/thoughtcrime/securesms/conversation/ConversationActivity.java +++ b/src/org/thoughtcrime/securesms/conversation/ConversationActivity.java @@ -2756,7 +2756,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity List> users = LokiAPI.Companion.getUsers("", threadId, userDatabase); mentionStartIndex = currentEndIndex + 1; userSelectionView.show(users, threadId); - } else if (Character.getType(lastCharacter) != Character.UPPERCASE_LETTER && Character.getType(lastCharacter) != Character.LOWERCASE_LETTER) { + } else if (Character.isWhitespace(lastCharacter)) { mentionStartIndex = -1; userSelectionView.hide(); } else { diff --git a/src/org/thoughtcrime/securesms/conversation/ConversationItem.java b/src/org/thoughtcrime/securesms/conversation/ConversationItem.java index e14e59a7f4..f341aad4f1 100644 --- a/src/org/thoughtcrime/securesms/conversation/ConversationItem.java +++ b/src/org/thoughtcrime/securesms/conversation/ConversationItem.java @@ -777,7 +777,7 @@ public class ConversationItem extends LinearLayout } private SpannableString highlightMentions(CharSequence text, boolean isGroupThread) { - Pattern pattern = Pattern.compile("@\\w*"); + Pattern pattern = Pattern.compile("@[0-9a-fA-F]*"); Matcher matcher = pattern.matcher(text); ArrayList> mentions = new ArrayList<>(); if (matcher.find() && isGroupThread) {