From 5d25b4c00a1ea2e94800735e768aed94dfc93969 Mon Sep 17 00:00:00 2001 From: Ethan Mateja Date: Mon, 4 Mar 2024 11:12:41 -0800 Subject: [PATCH] Group Preferences consentState Patch When implementing change for Group Preferences Actions, the consentState function was not updated. See PR: https://github.com/xmtp/xmtp-ios/pull/272 --- Sources/XMTPiOS/Conversation.swift | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Sources/XMTPiOS/Conversation.swift b/Sources/XMTPiOS/Conversation.swift index 683b04c1..099de748 100644 --- a/Sources/XMTPiOS/Conversation.swift +++ b/Sources/XMTPiOS/Conversation.swift @@ -31,18 +31,14 @@ public enum Conversation: Sendable { } public func consentState() async -> ConsentState { - let client: Client - switch self { case .v1(let conversationV1): - client = conversationV1.client + return await conversationV1.client.contacts.consentList.state(address: peerAddress) case .v2(let conversationV2): - client = conversationV2.client + return await conversationV2.client.contacts.consentList.state(address: peerAddress) case let .group(group): - client = group.client + return await group.client.contacts.consentList.groupState(groupId: group.id) } - - return await client.contacts.consentList.state(address: peerAddress) } public var version: Version {