mirror of
https://github.com/oxen-io/session-android.git
synced 2025-04-24 02:41:28 +00:00
Cleanup ConversationActivityV2
This commit is contained in:
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 isOutgoingMessageRequestThread(): Boolean {
|
private fun isIncomingMessageRequestThread(): Boolean = viewModel.recipient?.run {
|
||||||
val recipient = viewModel.recipient ?: return false
|
!isGroupRecipient && !isApproved && !isLocalNumber &&
|
||||||
return !recipient.isGroupRecipient &&
|
!threadDb.getLastSeenAndHasSent(viewModel.threadId).second() && threadDb.getMessageCount(viewModel.threadId) > 0
|
||||||
!recipient.isLocalNumber &&
|
} ?: false
|
||||||
!(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…
x
Reference in New Issue
Block a user