From 86309f59172ba153b74e670a82aecc29a7cf88cd Mon Sep 17 00:00:00 2001 From: Naomi Plasterer Date: Mon, 16 Dec 2024 12:34:23 -0800 Subject: [PATCH] add back the consent piece --- library/src/main/java/org/xmtp/android/library/Dm.kt | 3 +++ library/src/main/java/org/xmtp/android/library/Group.kt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/library/src/main/java/org/xmtp/android/library/Dm.kt b/library/src/main/java/org/xmtp/android/library/Dm.kt index aaaf6974..4b3f02b5 100644 --- a/library/src/main/java/org/xmtp/android/library/Dm.kt +++ b/library/src/main/java/org/xmtp/android/library/Dm.kt @@ -80,6 +80,9 @@ class Dm(val client: Client, private val libXMTPGroup: FfiConversation) { } fun prepareMessage(encodedContent: EncodedContent): String { + if (consentState() == ConsentState.UNKNOWN) { + updateConsentState(ConsentState.ALLOWED) + } return libXMTPGroup.sendOptimistic(encodedContent.toByteArray()).toHex() } diff --git a/library/src/main/java/org/xmtp/android/library/Group.kt b/library/src/main/java/org/xmtp/android/library/Group.kt index ae01c797..91392caa 100644 --- a/library/src/main/java/org/xmtp/android/library/Group.kt +++ b/library/src/main/java/org/xmtp/android/library/Group.kt @@ -97,6 +97,9 @@ class Group(val client: Client, private val libXMTPGroup: FfiConversation) { } fun prepareMessage(encodedContent: EncodedContent): String { + if (consentState() == ConsentState.UNKNOWN) { + updateConsentState(ConsentState.ALLOWED) + } return libXMTPGroup.sendOptimistic(encodedContent.toByteArray()).toHex() }