From 90c6eae9e4101b97eae986a2a91ba140befb2d1f Mon Sep 17 00:00:00 2001 From: Naomi Plasterer Date: Mon, 1 Jul 2024 14:40:11 -0700 Subject: [PATCH] fix up swift --- ios/Wrappers/ConversationWrapper.swift | 2 +- ios/XMTPModule.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ios/Wrappers/ConversationWrapper.swift b/ios/Wrappers/ConversationWrapper.swift index 103c6c629..81a4e74e0 100644 --- a/ios/Wrappers/ConversationWrapper.swift +++ b/ios/Wrappers/ConversationWrapper.swift @@ -26,7 +26,7 @@ struct ConversationWrapper { "topic": conversation.topic, "createdAt": UInt64(conversation.createdAt.timeIntervalSince1970 * 1000), "context": context, - "peerAddress": conversation.peerAddress, + "peerAddress": try conversation.peerAddress, "version": conversation.version == .v1 ? "v1" : "v2", "conversationID": conversation.conversationID ?? "", "keyMaterial": conversation.keyMaterial?.base64EncodedString() ?? "", diff --git a/ios/XMTPModule.swift b/ios/XMTPModule.swift index cfb89d939..1b77fc244 100644 --- a/ios/XMTPModule.swift +++ b/ios/XMTPModule.swift @@ -601,7 +601,7 @@ public class XMTPModule: Module { guard let conversation = try await findConversation(clientAddress: clientAddress, topic: conversationTopic) else { throw Error.conversationNotFound(conversationTopic) } - return ConsentWrapper.consentStateToString(state: await conversation.consentState()) + return ConsentWrapper.consentStateToString(state: try await conversation.consentState()) } AsyncFunction("consentList") { (clientAddress: String) -> [String] in @@ -682,7 +682,7 @@ public class XMTPModule: Module { await subscriptionsManager.get(getConversationsKey(clientAddress: clientAddress))?.cancel() await subscriptionsManager.set(getConversationsKey(clientAddress: clientAddress), Task { do { - for try await conversation in await client.conversations.stream() { + for try await conversation in try await client.conversations.stream() { try sendEvent("conversation", [ "clientAddress": clientAddress, "conversation": ConversationWrapper.encodeToObj(conversation, client: client),