This commit is contained in:
Niels Andriesse 2021-06-25 15:24:34 +10:00
parent 82e4d3125c
commit 20abe8fdb8

View File

@ -343,7 +343,6 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
val lastCharIndex = text.lastIndex val lastCharIndex = text.lastIndex
val lastChar = text[lastCharIndex] val lastChar = text[lastCharIndex]
// Check if there is whitespace before the '@' or the '@' is the first character // Check if there is whitespace before the '@' or the '@' is the first character
val isCharacterBeforeLastWhiteSpaceOrStartOfLine: Boolean val isCharacterBeforeLastWhiteSpaceOrStartOfLine: Boolean
if (text.length == 1) { if (text.length == 1) {
isCharacterBeforeLastWhiteSpaceOrStartOfLine = true // Start of line isCharacterBeforeLastWhiteSpaceOrStartOfLine = true // Start of line
@ -403,12 +402,6 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
isShowingMentionCandidatesView = false isShowingMentionCandidatesView = false
} }
private fun resetMentions() {
previousText = ""
currentMentionStartIndex = -1
mentions.clear()
}
override fun toggleAttachmentOptions() { override fun toggleAttachmentOptions() {
val targetAlpha = if (isShowingAttachmentOptions) 0.0f else 1.0f val targetAlpha = if (isShowingAttachmentOptions) 0.0f else 1.0f
val allButtons = listOf( cameraButtonContainer, libraryButtonContainer, documentButtonContainer, gifButtonContainer) val allButtons = listOf( cameraButtonContainer, libraryButtonContainer, documentButtonContainer, gifButtonContainer)
@ -639,23 +632,23 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
} }
override fun send() { override fun send() {
// Create the message
val message = VisibleMessage() val message = VisibleMessage()
message.sentTimestamp = System.currentTimeMillis() message.sentTimestamp = System.currentTimeMillis()
message.text = getMessageBody() message.text = getMessageBody()
val outgoingTextMessage = OutgoingTextMessage.from(message, thread) val outgoingTextMessage = OutgoingTextMessage.from(message, thread)
ApplicationContext.getInstance(this).typingStatusSender.onTypingStopped(threadID) // Clear the input bar
inputBar.text = ""
// silentlySetComposeText("") // Clear mentions
// val id: Long = fragment.stageOutgoingMessage(outgoingTextMessage) previousText = ""
// currentMentionStartIndex = -1
// if (initiating) { mentions.clear()
// DatabaseFactory.getRecipientDatabase(context).setProfileSharing(recipient, true) // Put the message in the database
// } message.id = DatabaseFactory.getSmsDatabase(this).insertMessageOutbox(threadID, outgoingTextMessage, false, message.sentTimestamp!!) { }
// // Send it
// val allocatedThreadId: Long = getAllocatedThreadId(context)
message.id = DatabaseFactory.getSmsDatabase(this).insertMessageOutbox(threadID, outgoingTextMessage, false, message.sentTimestamp!!) { /**fragment.releaseOutgoingMessage(id)*/ }
MessageSender.send(message, thread.address) MessageSender.send(message, thread.address)
// Send a typing stopped message
ApplicationContext.getInstance(this).typingStatusSender.onTypingStopped(threadID)
} }
// endregion // endregion