Cleanup ConversationViewModel

This commit is contained in:
Andrew 2024-02-18 02:22:02 +10:30
parent c5c3365b18
commit 88dfceed67

View File

@ -223,12 +223,10 @@ class ConversationViewModel(
fun hidesInputBar(): Boolean = openGroup?.canWrite != true && fun hidesInputBar(): Boolean = openGroup?.canWrite != true &&
blindedRecipient?.blocksCommunityMessageRequests == true blindedRecipient?.blocksCommunityMessageRequests == true
fun legacyBannerRecipient(context: Context): Recipient? = recipient?.let { recipient -> fun legacyBannerRecipient(context: Context): Recipient? = recipient?.run {
val legacyAddress = storage.getLastLegacyRecipient(recipient.address.serialize()) ?: return@let null storage.getLastLegacyRecipient(address.serialize())?.let { Recipient.from(context, Address.fromSerialized(it), false) }
return Recipient.from(context, Address.fromSerialized(legacyAddress), false)
} }
@dagger.assisted.AssistedFactory @dagger.assisted.AssistedFactory
interface AssistedFactory { interface AssistedFactory {
fun create(threadId: Long, edKeyPair: KeyPair?): Factory fun create(threadId: Long, edKeyPair: KeyPair?): Factory