diff --git a/Sources/XMTP/Contacts.swift b/Sources/XMTP/Contacts.swift index a728a149..c5ab8a12 100644 --- a/Sources/XMTP/Contacts.swift +++ b/Sources/XMTP/Contacts.swift @@ -77,7 +77,7 @@ class ConsentList { preferences.append(try PrivatePreferencesAction(serializedData: Data(payload))) } - preferences.forEach { preference in + preferences.reversed().forEach { preference in preference.allow.walletAddresses.forEach { address in consentList.allow(address: address) } diff --git a/Tests/XMTPTests/ConversationTests.swift b/Tests/XMTPTests/ConversationTests.swift index 25092677..006b2486 100644 --- a/Tests/XMTPTests/ConversationTests.swift +++ b/Tests/XMTPTests/ConversationTests.swift @@ -612,6 +612,13 @@ class ConversationTests: XCTestCase { // Conversations you start should start as allowed XCTAssertTrue(isAllowed) + + try await bobClient.contacts.block(addresses: [alice.address]) + try await bobClient.contacts.refreshConsentList() + + let isBlocked = (await bobConversation.consentState()) == .blocked + + XCTAssertTrue(isBlocked) let aliceConversation = (try await aliceClient.conversations.list())[0] let isUnknown = (await aliceConversation.consentState()) == .unknown diff --git a/XMTP.podspec b/XMTP.podspec index 8a8b2709..5516042c 100644 --- a/XMTP.podspec +++ b/XMTP.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |spec| # spec.name = "XMTP" - spec.version = "0.6.3-alpha0" + spec.version = "0.6.4-alpha0" spec.summary = "XMTP SDK Cocoapod" # This description is used to generate tags and improve search results.