mirror of
https://codeberg.org/tom79/Fedilab.git
synced 2025-07-23 12:00:31 +03:00
Fix issue 442 - Only use the actual mention match
This commit is contained in:
parent
a10b404677
commit
8e5685aad2
1 changed files with 2 additions and 2 deletions
|
@ -718,7 +718,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
|||
* @return {@link TextWatcher}
|
||||
*/
|
||||
public TextWatcher initializeTextWatcher(ComposeAdapter.ComposeViewHolder holder) {
|
||||
String pattern = "(.|\\s)*(@[\\w_-]+@[a-z0-9.\\-]+|@[\\w_-]+)";
|
||||
String pattern = "(.|\\s)*(?<mention>@[\\w_-]+@[a-z0-9.\\-]+|@[\\w_-]+)";
|
||||
final Pattern mentionPattern = Pattern.compile(pattern);
|
||||
|
||||
String patternTag = "^(.|\\s)*(#([\\w-]{2,}))$";
|
||||
|
@ -884,7 +884,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
|||
matcherTag = tagPattern.matcher(searchIn);
|
||||
matcherEmoji = emojiPattern.matcher(searchIn);
|
||||
if (matcherMention.matches()) {
|
||||
String searchGroup = matcherMention.group();
|
||||
String searchGroup = matcherMention.group("mention");
|
||||
accountsVM.searchAccounts(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, searchGroup, 10, true, false).observe((LifecycleOwner) context, accounts -> {
|
||||
if (accounts == null) {
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue