diff --git a/Sources/XMTPiOS/Group.swift b/Sources/XMTPiOS/Group.swift index 5116d9f8..69e412b4 100644 --- a/Sources/XMTPiOS/Group.swift +++ b/Sources/XMTPiOS/Group.swift @@ -12,7 +12,7 @@ public struct Group: Identifiable, Equatable, Hashable { var ffiGroup: FfiGroup var client: Client - public struct Member { + struct Member { var ffiGroupMember: FfiGroupMember public var accountAddress: String { @@ -36,9 +36,9 @@ public struct Group: Identifiable, Equatable, Hashable { id.hash(into: &hasher) } - public var members: [Member] { + public var members: [String] { do { - return try ffiGroup.listMembers().map(\.fromFFI) + return try ffiGroup.listMembers().map(\.fromFFI.accountAddress) } catch { return [] } diff --git a/Tests/XMTPTests/GroupTests.swift b/Tests/XMTPTests/GroupTests.swift index 66360dc0..f9e1da1a 100644 --- a/Tests/XMTPTests/GroupTests.swift +++ b/Tests/XMTPTests/GroupTests.swift @@ -96,7 +96,7 @@ class GroupTests: XCTestCase { let group = try await fixtures.aliceClient.conversations.newGroup(with: [fixtures.bob.address]) try await group.sync() - let members = group.members.map(\.accountAddress.localizedLowercase).sorted() + let members = group.members.map(\.localizedLowercase).sorted() XCTAssertEqual([fixtures.bob.address.localizedLowercase, fixtures.alice.address.localizedLowercase].sorted(), members) } @@ -108,7 +108,7 @@ class GroupTests: XCTestCase { try await group.addMembers(addresses: [fixtures.fred.address]) try await group.sync() - let members = group.members.map(\.accountAddress.localizedLowercase).sorted() + let members = group.members.map(\.localizedLowercase).sorted() XCTAssertEqual([ fixtures.bob.address.localizedLowercase, @@ -125,7 +125,7 @@ class GroupTests: XCTestCase { let group = try await fixtures.aliceClient.conversations.newGroup(with: [fixtures.bob.address, fixtures.fred.address]) try await group.sync() - let members = group.members.map(\.accountAddress.localizedLowercase).sorted() + let members = group.members.map(\.localizedLowercase).sorted() XCTAssertEqual([ fixtures.bob.address.localizedLowercase, @@ -137,7 +137,7 @@ class GroupTests: XCTestCase { try await group.sync() - let newMembers = group.members.map(\.accountAddress.localizedLowercase).sorted() + let newMembers = group.members.map(\.localizedLowercase).sorted() XCTAssertEqual([ fixtures.bob.address.localizedLowercase, fixtures.alice.address.localizedLowercase,