From 90c88e8f56ec2140bb3b0c5856e99f4b98ca26ff Mon Sep 17 00:00:00 2001 From: Naomi Plasterer Date: Tue, 17 Dec 2024 14:27:22 -0800 Subject: [PATCH] more fixes --- Sources/XMTPiOS/Client.swift | 10 ++++++---- Sources/XMTPiOS/Conversation.swift | 4 ++-- Sources/XMTPiOS/Extensions/Ffi.swift | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Sources/XMTPiOS/Client.swift b/Sources/XMTPiOS/Client.swift index 3c2e546b..1c1b5d4c 100644 --- a/Sources/XMTPiOS/Client.swift +++ b/Sources/XMTPiOS/Client.swift @@ -204,8 +204,9 @@ public final class Client { let dbURL = directoryURL.appendingPathComponent(alias).path let ffiClient = try await LibXMTP.createClient( - host: options.api.env.url, - isSecure: options.api.env.isSecure == true, + api: connectToBackend( + host: options.api.env.url, + isSecure: options.api.env.isSecure == true), db: dbURL, encryptionKey: options.dbEncryptionKey, inboxId: inboxId, @@ -297,8 +298,9 @@ public final class Client { let dbURL = directoryURL.appendingPathComponent(alias).path let ffiClient = try await LibXMTP.createClient( - host: api.env.url, - isSecure: api.env.isSecure == true, + api: connectToBackend( + host: api.env.url, + isSecure: api.env.isSecure == true), db: dbURL, encryptionKey: nil, inboxId: inboxId, diff --git a/Sources/XMTPiOS/Conversation.swift b/Sources/XMTPiOS/Conversation.swift index cddcc4c3..b84075d8 100644 --- a/Sources/XMTPiOS/Conversation.swift +++ b/Sources/XMTPiOS/Conversation.swift @@ -29,9 +29,9 @@ public enum Conversation: Identifiable, Equatable, Hashable { public func isCreator() async throws -> Bool { switch self { case let .group(group): - return try group.isCreator() + return try await group.isCreator() case let .dm(dm): - return try dm.isCreator() + return try await dm.isCreator() } } diff --git a/Sources/XMTPiOS/Extensions/Ffi.swift b/Sources/XMTPiOS/Extensions/Ffi.swift index 9ab1334d..3587f779 100644 --- a/Sources/XMTPiOS/Extensions/Ffi.swift +++ b/Sources/XMTPiOS/Extensions/Ffi.swift @@ -10,8 +10,8 @@ extension FfiConversation { Dm(ffiConversation: self, client: client) } - func toConversation(client: Client) throws -> Conversation { - if try conversationType() == .dm { + func toConversation(client: Client) async throws -> Conversation { + if try await conversationType() == .dm { return Conversation.dm(self.dmFromFFI(client: client)) } else { return Conversation.group(self.groupFromFFI(client: client))