diff --git a/Tests/XMTPTests/GroupTests.swift b/Tests/XMTPTests/GroupTests.swift index f9e1da1a..0a6c3524 100644 --- a/Tests/XMTPTests/GroupTests.swift +++ b/Tests/XMTPTests/GroupTests.swift @@ -48,17 +48,29 @@ class GroupTests: XCTestCase { let alice = try PrivateKey.generate() let aliceClient = try await Client.create( account: alice, - options: .init(api: .init(env: .local, isSecure: false), codecs: [GroupMembershipChangedCodec()], enableAlphaMLS: true) + options: .init( + api: .init(env: .local, isSecure: false), + codecs: [GroupMembershipChangedCodec()], + mlsAlpha: true + ) ) let bob = try PrivateKey.generate() let bobClient = try await Client.create( account: bob, - options: .init(api: .init(env: .local, isSecure: false), codecs: [GroupMembershipChangedCodec()], enableAlphaMLS: true) + options: .init( + api: .init(env: .local, isSecure: false), + codecs: [GroupMembershipChangedCodec()], + mlsAlpha: true + ) ) let fred = try PrivateKey.generate() let fredClient = try await Client.create( account: fred, - options: .init(api: .init(env: .local, isSecure: false), codecs: [GroupMembershipChangedCodec()], enableAlphaMLS: true) + options: .init( + api: .init(env: .local, isSecure: false), + codecs: [GroupMembershipChangedCodec()], + mlsAlpha: true + ) ) return .init( diff --git a/XMTPiOSExample/XMTPiOSExample/ContentView.swift b/XMTPiOSExample/XMTPiOSExample/ContentView.swift index 68b1dda5..af8e9f3f 100644 --- a/XMTPiOSExample/XMTPiOSExample/ContentView.swift +++ b/XMTPiOSExample/XMTPiOSExample/ContentView.swift @@ -52,7 +52,7 @@ struct ContentView: View { options: .init( api: .init(env: .local, isSecure: false), codecs: [GroupMembershipChangedCodec()], - enableAlphaMLS: true + mlsAlpha: true ) ) await MainActor.run { @@ -97,7 +97,7 @@ struct ContentView: View { options: .init( api: .init(env: .local, isSecure: false, appVersion: "XMTPTest/v1.0.0"), codecs: [GroupMembershipChangedCodec()], - enableAlphaMLS: true + mlsAlpha: true ) ) diff --git a/XMTPiOSExample/XMTPiOSExample/Views/ConversationListView.swift b/XMTPiOSExample/XMTPiOSExample/Views/ConversationListView.swift index b7211269..16c84007 100644 --- a/XMTPiOSExample/XMTPiOSExample/Views/ConversationListView.swift +++ b/XMTPiOSExample/XMTPiOSExample/Views/ConversationListView.swift @@ -79,6 +79,8 @@ struct ConversationListView: View { ConversationOrGroup.conversation($0) } + try await client.conversations.sync() + let groups = try await client.conversations.groups().map { ConversationOrGroup.group($0) } diff --git a/XMTPiOSExample/XMTPiOSExample/Views/GroupDetailView.swift b/XMTPiOSExample/XMTPiOSExample/Views/GroupDetailView.swift index 08062899..a162ec16 100644 --- a/XMTPiOSExample/XMTPiOSExample/Views/GroupDetailView.swift +++ b/XMTPiOSExample/XMTPiOSExample/Views/GroupDetailView.swift @@ -38,6 +38,7 @@ struct GroupDetailView: View { func loadMessages() async { do { + try await group.sync() let messages = try await group.messages() await MainActor.run { self.messages = messages diff --git a/XMTPiOSExample/XMTPiOSExample/Views/LoginView.swift b/XMTPiOSExample/XMTPiOSExample/Views/LoginView.swift index 57daf7c8..38f46ad0 100644 --- a/XMTPiOSExample/XMTPiOSExample/Views/LoginView.swift +++ b/XMTPiOSExample/XMTPiOSExample/Views/LoginView.swift @@ -165,7 +165,7 @@ struct LoginView: View { options: .init( api: .init(env: .local, isSecure: false), codecs: [GroupMembershipChangedCodec()], - enableAlphaMLS: true + mlsAlpha: true ) ) diff --git a/XMTPiOSExample/XMTPiOSExample/Views/NewConversationView.swift b/XMTPiOSExample/XMTPiOSExample/Views/NewConversationView.swift index e795f715..5ee7e4fc 100644 --- a/XMTPiOSExample/XMTPiOSExample/Views/NewConversationView.swift +++ b/XMTPiOSExample/XMTPiOSExample/Views/NewConversationView.swift @@ -24,7 +24,7 @@ enum ConversationOrGroup: Identifiable, Hashable { case .conversation(let conversation): return conversation.peerAddress case .group(let group): - return group.members.map(\.accountAddress).joined(separator: ",") + return group.members.joined(separator: ",") } } } @@ -111,6 +111,7 @@ struct NewConversationView: View { Task { do { let group = try await client.conversations.newGroup(with: groupMembers) + try await client.conversations.sync() await MainActor.run { onCreate(.group(group)) }