mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-12 13:23:40 +00:00
Quick fix crash
This commit is contained in:
parent
0f364fcea7
commit
ca9032e109
@ -413,6 +413,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
composeText.setText(newText);
|
composeText.setText(newText);
|
||||||
composeText.setSelection(newText.length());
|
composeText.setSelection(newText.length());
|
||||||
userSelectionView.hide();
|
userSelectionView.hide();
|
||||||
|
currentMentionStartIndex = -1;
|
||||||
return Unit.INSTANCE;
|
return Unit.INSTANCE;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -2094,10 +2095,14 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
if (result.length() < 1 && !attachmentManager.isAttachmentPresent()) throw new InvalidMessageException();
|
if (result.length() < 1 && !attachmentManager.isAttachmentPresent()) throw new InvalidMessageException();
|
||||||
int shift = 0;
|
int shift = 0;
|
||||||
for (Mention mention : mentions) {
|
for (Mention mention : mentions) {
|
||||||
int startIndex = mention.getLocationInString() + shift;
|
try {
|
||||||
int endIndex = startIndex + mention.getDisplayName().length() + 1; // + 1 to include the @
|
int startIndex = mention.getLocationInString() + shift;
|
||||||
shift = shift + mention.getHexEncodedPublicKey().length() - mention.getDisplayName().length();
|
int endIndex = startIndex + mention.getDisplayName().length() + 1; // + 1 to include the @
|
||||||
result = result.substring(0, startIndex) + "@" + mention.getHexEncodedPublicKey() + result.substring(endIndex);
|
shift = shift + mention.getHexEncodedPublicKey().length() - mention.getDisplayName().length();
|
||||||
|
result = result.substring(0, startIndex) + "@" + mention.getHexEncodedPublicKey() + result.substring(endIndex);
|
||||||
|
} catch (Exception exception) {
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user