Cleanup ConversationActivityV2

pull/1313/head
Andrew 1 year ago
parent 835fa6882b
commit d33de9cf6b

@ -866,27 +866,15 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
} }
} }
private fun isMessageRequestThread(): Boolean { private fun isOutgoingMessageRequestThread(): Boolean = viewModel.recipient?.run {
val recipient = viewModel.recipient ?: return false !isGroupRecipient && !isLocalNumber &&
if (recipient.isLocalNumber) return false !(hasApprovedMe() || viewModel.hasReceived())
return !recipient.isGroupRecipient && !recipient.isApproved } ?: false
}
private fun isIncomingMessageRequestThread(): Boolean = viewModel.recipient?.run {
private fun isOutgoingMessageRequestThread(): Boolean { !isGroupRecipient && !isApproved && !isLocalNumber &&
val recipient = viewModel.recipient ?: return false !threadDb.getLastSeenAndHasSent(viewModel.threadId).second() && threadDb.getMessageCount(viewModel.threadId) > 0
return !recipient.isGroupRecipient && } ?: false
!recipient.isLocalNumber &&
!(recipient.hasApprovedMe() || viewModel.hasReceived())
}
private fun isIncomingMessageRequestThread(): Boolean {
val recipient = viewModel.recipient ?: return false
return !recipient.isGroupRecipient &&
!recipient.isApproved &&
!recipient.isLocalNumber &&
!threadDb.getLastSeenAndHasSent(viewModel.threadId).second() &&
threadDb.getMessageCount(viewModel.threadId) > 0
}
override fun inputBarEditTextContentChanged(newContent: CharSequence) { override fun inputBarEditTextContentChanged(newContent: CharSequence) {
val inputBarText = binding?.inputBar?.text ?: return // TODO check if we should be referencing newContent here instead val inputBarText = binding?.inputBar?.text ?: return // TODO check if we should be referencing newContent here instead

Loading…
Cancel
Save