diff --git a/library/src/androidTest/java/org/xmtp/android/library/ConversationTest.kt b/library/src/androidTest/java/org/xmtp/android/library/ConversationTest.kt index 85110bb82..8a797e70e 100644 --- a/library/src/androidTest/java/org/xmtp/android/library/ConversationTest.kt +++ b/library/src/androidTest/java/org/xmtp/android/library/ConversationTest.kt @@ -750,4 +750,27 @@ class ConversationTest { assertTrue(isBobAllowed2) } + + @Test + fun testImplicitConsentWhenSendingAMessage() { + val bobConversation = bobClient.conversations.newConversation(alice.walletAddress, null) + val isAllowed = bobConversation.consentState() == ConsentState.ALLOWED + + // Conversations you start should start as allowed + assertTrue(isAllowed) + + val aliceConversation = aliceClient.conversations.list()[0] + val isUnknown = aliceConversation.consentState() == ConsentState.UNKNOWN + + // Conversations you receive should start as unknown + assertTrue(isUnknown) + + aliceConversation.send(content = "hey bob") + aliceClient.contacts.refreshConsentList() + val isNowAllowed = aliceConversation.consentState() == ConsentState.ALLOWED + + // Conversations you send a message to get marked as allowed + assertTrue(isNowAllowed) + + } }