mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-27 08:55:54 +03:00
parent
b35a1c0758
commit
ccce05e164
1 changed files with 5 additions and 2 deletions
|
@ -370,7 +370,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
||||||
@Override
|
@Override
|
||||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
if (s.length() == 1000) {
|
if (s.length() == 1000) {
|
||||||
messageInput.setError(getResources().getString(R.string.nc_limit_hit));
|
messageInput.setError(Objects.requireNonNull(getResources()).getString(R.string.nc_limit_hit));
|
||||||
} else {
|
} else {
|
||||||
messageInput.setError(null);
|
messageInput.setError(null);
|
||||||
}
|
}
|
||||||
|
@ -381,10 +381,13 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
||||||
for (int i = 0; i < mentionSpans.length; i++) {
|
for (int i = 0; i < mentionSpans.length; i++) {
|
||||||
mentionSpan = mentionSpans[i];
|
mentionSpan = mentionSpans[i];
|
||||||
if (start >= editable.getSpanStart(mentionSpan) && start < editable.getSpanEnd(mentionSpan)) {
|
if (start >= editable.getSpanStart(mentionSpan) && start < editable.getSpanEnd(mentionSpan)) {
|
||||||
|
if (!editable.subSequence(editable.getSpanStart(mentionSpan),
|
||||||
|
editable.getSpanEnd(mentionSpan)).toString().trim().equals(mentionSpan.getLabel())) {
|
||||||
editable.removeSpan(mentionSpan);
|
editable.removeSpan(mentionSpan);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterTextChanged(Editable s) {
|
public void afterTextChanged(Editable s) {
|
||||||
|
|
Loading…
Reference in a new issue