mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 01:07:47 +00:00
fix up the crash of mention. fix up the '@' issue.
This commit is contained in:
parent
a307a8e207
commit
2677599953
@ -109,7 +109,7 @@ public class AvatarImageView extends AppCompatImageView {
|
||||
|
||||
public void update(String hexEncodedPublicKey) {
|
||||
Address address = Address.fromSerialized(hexEncodedPublicKey);
|
||||
if (!address.equals(recipient.getAddress())) {
|
||||
if (recipient == null || !address.equals(recipient.getAddress())) {
|
||||
this.recipient = Recipient.from(getContext(), address, false);
|
||||
updateImage();
|
||||
}
|
||||
|
@ -2845,10 +2845,14 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
}
|
||||
int lastCharacterIndex = text.length() - 1;
|
||||
char lastCharacter = text.charAt(lastCharacterIndex);
|
||||
char secondLastChar = ' ';
|
||||
if (lastCharacterIndex > 0) {
|
||||
secondLastChar = text.charAt(lastCharacterIndex - 1);
|
||||
}
|
||||
String userHexEncodedPublicKey = TextSecurePreferences.getLocalNumber(ConversationActivity.this);
|
||||
LokiThreadDatabase threadDatabase = DatabaseFactory.getLokiThreadDatabase(ConversationActivity.this);
|
||||
LokiUserDatabase userDatabase = DatabaseFactory.getLokiUserDatabase(ConversationActivity.this);
|
||||
if (lastCharacter == '@') {
|
||||
if (lastCharacter == '@' && Character.isWhitespace(secondLastChar)) {
|
||||
List<Mention> mentionCandidates = LokiAPI.Companion.getMentionCandidates("", threadId, userHexEncodedPublicKey, threadDatabase, userDatabase);
|
||||
currentMentionStartIndex = lastCharacterIndex;
|
||||
mentionCandidateSelectionView.show(mentionCandidates, threadId);
|
||||
|
Loading…
x
Reference in New Issue
Block a user