Ensure that mention behavior is consistent cross-platform

This commit is contained in:
Niels Andriesse 2019-10-10 16:29:58 +11:00
parent 20f303b2a2
commit 3d78dac65c
2 changed files with 2 additions and 2 deletions

View File

@ -2756,7 +2756,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
List<Tuple2<String, String>> 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 {

View File

@ -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<Range<Integer>> mentions = new ArrayList<>();
if (matcher.find() && isGroupThread) {