diff --git a/library/src/androidTest/java/org/xmtp/android/library/ContactsTest.kt b/library/src/androidTest/java/org/xmtp/android/library/ContactsTest.kt index 3ccf68486..7cb2f6104 100644 --- a/library/src/androidTest/java/org/xmtp/android/library/ContactsTest.kt +++ b/library/src/androidTest/java/org/xmtp/android/library/ContactsTest.kt @@ -62,9 +62,9 @@ class ContactsTest { assert(!result) - contacts.block(listOf(fixtures.alice.walletAddress)) + contacts.deny(listOf(fixtures.alice.walletAddress)) - result = contacts.isBlocked(fixtures.alice.walletAddress) + result = contacts.isDenied(fixtures.alice.walletAddress) assert(result) } } 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 fd89485eb..85110bb82 100644 --- a/library/src/androidTest/java/org/xmtp/android/library/ConversationTest.kt +++ b/library/src/androidTest/java/org/xmtp/android/library/ConversationTest.kt @@ -723,11 +723,11 @@ class ConversationTest { assertTrue(isAllowed) assertTrue(bobClient.contacts.isAllowed(alice.walletAddress)) - bobClient.contacts.block(listOf(alice.walletAddress)) + bobClient.contacts.deny(listOf(alice.walletAddress)) bobClient.contacts.refreshConsentList() - val isBlocked = bobConversation.consentState() == ConsentState.BLOCKED - assertTrue(isBlocked) + val isDenied = bobConversation.consentState() == ConsentState.DENIED + assertTrue(isDenied) val aliceConversation = aliceClient.conversations.list()[0] val isUnknown = aliceConversation.consentState() == ConsentState.UNKNOWN diff --git a/library/src/main/java/org/xmtp/android/library/Contacts.kt b/library/src/main/java/org/xmtp/android/library/Contacts.kt index 01e92af38..1a4ed3db9 100644 --- a/library/src/main/java/org/xmtp/android/library/Contacts.kt +++ b/library/src/main/java/org/xmtp/android/library/Contacts.kt @@ -11,7 +11,7 @@ import java.util.Date enum class ConsentState { ALLOWED, - BLOCKED, + DENIED, UNKNOWN } @@ -73,7 +73,7 @@ class ConsentList(val client: Client) { consentList.allow(address) } preference.block?.walletAddressesList?.forEach { address -> - consentList.block(address) + consentList.deny(address) } } @@ -88,7 +88,7 @@ class ConsentList(val client: Client) { PrivatePreferencesAction.Allow.newBuilder().addWalletAddresses(entry.value) ) - ConsentState.BLOCKED -> it.setBlock( + ConsentState.DENIED -> it.setBlock( PrivatePreferencesAction.Block.newBuilder().addWalletAddresses(entry.value) ) @@ -117,10 +117,10 @@ class ConsentList(val client: Client) { return ConsentListEntry.address(address, ConsentState.ALLOWED) } - fun block(address: String): ConsentListEntry { - entries[ConsentListEntry.address(address).key] = ConsentState.BLOCKED + fun deny(address: String): ConsentListEntry { + entries[ConsentListEntry.address(address).key] = ConsentState.DENIED - return ConsentListEntry.address(address, ConsentState.BLOCKED) + return ConsentListEntry.address(address, ConsentState.DENIED) } fun state(address: String): ConsentState { @@ -148,8 +148,8 @@ data class Contacts( return consentList.state(address) == ConsentState.ALLOWED } - fun isBlocked(address: String): Boolean { - return consentList.state(address) == ConsentState.BLOCKED + fun isDenied(address: String): Boolean { + return consentList.state(address) == ConsentState.DENIED } fun allow(addresses: List) { @@ -158,9 +158,9 @@ data class Contacts( } } - fun block(addresses: List) { + fun deny(addresses: List) { for (address in addresses) { - ConsentList(client).publish(consentList.block(address)) + ConsentList(client).publish(consentList.deny(address)) } }