Improve mention

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2019-03-05 14:31:13 +01:00
parent d6a7a2ff94
commit f4508bc4fe

View file

@ -666,13 +666,11 @@ public class ChatController extends BaseController implements MessagesListAdapte
final Editable editable = messageInput.getEditableText();
Spans.MentionSpan mentionSpans[] = editable.getSpans(0, editable.length(), Spans.MentionSpan.class);
Spans.MentionSpan mentionSpan;
mentionAutocomplete.setEnabled(false);
for (int i = 0; i < mentionSpans.length; i++) {
mentionSpan = mentionSpans[i];
editable.replace(editable.getSpanStart(mentionSpan), editable.getSpanEnd(mentionSpan), "@" + mentionSpan.getId());
}
mentionAutocomplete.setEnabled(true);
messageInput.setText("");
sendMessage(editable);
}