Skip to content

Commit

Permalink
reverse the preference order so that we just input the most recent on…
Browse files Browse the repository at this point in the history
…es last (#181)
  • Loading branch information
nplasterer authored Oct 26, 2023
1 parent 74ea77a commit de6191a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/XMTP/Contacts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
7 changes: 7 additions & 0 deletions Tests/XMTPTests/ConversationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion XMTP.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit de6191a

Please sign in to comment.