diff --git a/library/src/main/java/org/xmtp/android/library/ConversationV1.kt b/library/src/main/java/org/xmtp/android/library/ConversationV1.kt index cb42f0b75..8cd10cb50 100644 --- a/library/src/main/java/org/xmtp/android/library/ConversationV1.kt +++ b/library/src/main/java/org/xmtp/android/library/ConversationV1.kt @@ -107,6 +107,9 @@ data class ConversationV1( fun send(prepared: PreparedMessage): String { client.publish(envelopes = prepared.envelopes) + if (client.contacts.consentList.state(address = peerAddress) == ConsentState.UNKNOWN) { + client.contacts.allow(addresses = listOf(peerAddress)) + } return prepared.messageId } diff --git a/library/src/main/java/org/xmtp/android/library/ConversationV2.kt b/library/src/main/java/org/xmtp/android/library/ConversationV2.kt index add87e246..1e4388b36 100644 --- a/library/src/main/java/org/xmtp/android/library/ConversationV2.kt +++ b/library/src/main/java/org/xmtp/android/library/ConversationV2.kt @@ -119,6 +119,9 @@ data class ConversationV2( fun send(prepared: PreparedMessage): String { client.publish(envelopes = prepared.envelopes) + if (client.contacts.consentList.state(address = peerAddress) == ConsentState.UNKNOWN) { + client.contacts.allow(addresses = listOf(peerAddress)) + } return prepared.messageId }