diff --git a/android/build.gradle b/android/build.gradle index a8d725aa1..d029f957b 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -101,7 +101,7 @@ dependencies { implementation 'com.google.code.gson:gson:2.10.1' implementation 'com.facebook.react:react-native:0.71.3' implementation "com.daveanthonythomas.moshipack:moshipack:1.0.1" - implementation "org.xmtp:android:0.7.15" + implementation "org.xmtp:android:0.7.17" // xmtp-android local testing setup below (comment org.xmtp:android above) // implementation files('/xmtp-android/library/build/outputs/aar/library-debug.aar') // implementation 'com.google.crypto.tink:tink-android:1.7.0' diff --git a/android/src/main/java/expo/modules/xmtpreactnativesdk/wrappers/GroupWrapper.kt b/android/src/main/java/expo/modules/xmtpreactnativesdk/wrappers/GroupWrapper.kt index da6d07f4e..0529773f0 100644 --- a/android/src/main/java/expo/modules/xmtpreactnativesdk/wrappers/GroupWrapper.kt +++ b/android/src/main/java/expo/modules/xmtpreactnativesdk/wrappers/GroupWrapper.kt @@ -4,6 +4,7 @@ import android.util.Base64 import android.util.Base64.NO_WRAP import com.google.gson.GsonBuilder import org.xmtp.android.library.Client +import org.xmtp.android.library.Conversation import org.xmtp.android.library.Group import org.xmtp.android.library.toHex import uniffi.xmtpv3.GroupPermissions @@ -20,7 +21,7 @@ class GroupWrapper { "clientAddress" to client.address, "id" to group.id.toHex(), "createdAt" to group.createdAt.time, - "peerAddresses" to group.memberAddresses(), + "peerAddresses" to Conversation.Group(group).peerAddresses, "version" to "GROUP", "topic" to group.id.toHex(), "permissionLevel" to permissionString, diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index e35aac798..98318b310 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -442,7 +442,7 @@ PODS: - GenericJSON (~> 2.0) - Logging (~> 1.0.0) - secp256k1.swift (~> 0.1) - - XMTP (0.8.10): + - XMTP (0.8.13): - Connect-Swift (= 0.3.0) - GzipSwift - LibXMTP (= 0.4.2-beta3) @@ -451,7 +451,7 @@ PODS: - ExpoModulesCore - MessagePacker - secp256k1.swift - - XMTP (= 0.8.10) + - XMTP (= 0.8.13) - Yoga (1.14.0) DEPENDENCIES: @@ -744,8 +744,8 @@ SPEC CHECKSUMS: secp256k1.swift: a7e7a214f6db6ce5db32cc6b2b45e5c4dd633634 SwiftProtobuf: b02b5075dcf60c9f5f403000b3b0c202a11b6ae1 web3.swift: 2263d1e12e121b2c42ffb63a5a7beb1acaf33959 - XMTP: 2c9f62b75b68e28ce91b67a7fb56ca71b7e22e87 - XMTPReactNative: 734154aef1c07f656641a587e9cc31e8cf8b587b + XMTP: 0424f5521008373eaa0a8cdba9d4244ba13700f2 + XMTPReactNative: cba9ca301d6ae82f649702e5befb3551f98d679f Yoga: e71803b4c1fff832ccf9b92541e00f9b873119b9 PODFILE CHECKSUM: 95d6ace79946933ecf80684613842ee553dd76a2 diff --git a/example/src/tests/groupTests.ts b/example/src/tests/groupTests.ts index 6314943a0..ee6e57ec9 100644 --- a/example/src/tests/groupTests.ts +++ b/example/src/tests/groupTests.ts @@ -131,6 +131,10 @@ test('can message in a group', async () => { if (memberAddresses.length !== 3) { throw new Error('num group members should be 3') } + const peerAddresses = await aliceGroup.peerAddresses + if (peerAddresses.length !== 2) { + throw new Error('num peer group members should be 2') + } const lowercasedAddresses: string[] = memberAddresses.map((s) => s.toLowerCase() ) @@ -144,6 +148,18 @@ test('can message in a group', async () => { throw new Error('missing address') } + const lowercasedPeerAddresses: string[] = peerAddresses.map((s) => + s.toLowerCase() + ) + if ( + !( + lowercasedPeerAddresses.includes(bobClient.address.toLowerCase()) && + lowercasedPeerAddresses.includes(camClient.address.toLowerCase()) + ) + ) { + throw new Error('should include self') + } + // Alice can send messages await aliceGroup.send('hello, world') await aliceGroup.send('gm') diff --git a/ios/Wrappers/GroupWrapper.swift b/ios/Wrappers/GroupWrapper.swift index 0be981934..24cbe0fd7 100644 --- a/ios/Wrappers/GroupWrapper.swift +++ b/ios/Wrappers/GroupWrapper.swift @@ -21,7 +21,7 @@ struct GroupWrapper { "clientAddress": client.address, "id": group.id.toHex, "createdAt": UInt64(group.createdAt.timeIntervalSince1970 * 1000), - "peerAddresses": group.memberAddresses, + "peerAddresses": XMTP.Conversation.group(group).peerAddresses, "version": "GROUP", "topic": group.id.toHex, "permissionLevel": permissionString, diff --git a/ios/XMTPReactNative.podspec b/ios/XMTPReactNative.podspec index 97b1f096a..f666457ac 100644 --- a/ios/XMTPReactNative.podspec +++ b/ios/XMTPReactNative.podspec @@ -26,5 +26,5 @@ Pod::Spec.new do |s| s.source_files = "**/*.{h,m,swift}" s.dependency 'secp256k1.swift' s.dependency "MessagePacker" - s.dependency "XMTP", "= 0.8.10" + s.dependency "XMTP", "= 0.8.13" end