From b7575226d1556a9a383db4314a021e886c008d0d Mon Sep 17 00:00:00 2001 From: Naomi Plasterer Date: Wed, 14 Feb 2024 15:04:27 -0800 Subject: [PATCH] lets just hex this instead of base 64 --- .../java/expo/modules/xmtpreactnativesdk/XMTPModule.kt | 2 +- .../modules/xmtpreactnativesdk/wrappers/GroupWrapper.kt | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/android/src/main/java/expo/modules/xmtpreactnativesdk/XMTPModule.kt b/android/src/main/java/expo/modules/xmtpreactnativesdk/XMTPModule.kt index e438284d9..155bdcb12 100644 --- a/android/src/main/java/expo/modules/xmtpreactnativesdk/XMTPModule.kt +++ b/android/src/main/java/expo/modules/xmtpreactnativesdk/XMTPModule.kt @@ -897,7 +897,7 @@ class XMTPModule : Module() { "group", mapOf( "clientAddress" to clientAddress, - "group" to GroupWrapper.encodeToObj(client, group, Base64.encodeToString(group.id, NO_WRAP)) + "group" to GroupWrapper.encodeToObj(client, group) ) ) } 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 e34bd7d5f..a594d9893 100644 --- a/android/src/main/java/expo/modules/xmtpreactnativesdk/wrappers/GroupWrapper.kt +++ b/android/src/main/java/expo/modules/xmtpreactnativesdk/wrappers/GroupWrapper.kt @@ -5,18 +5,19 @@ import android.util.Base64.NO_WRAP import com.google.gson.GsonBuilder import org.xmtp.android.library.Client import org.xmtp.android.library.Group +import org.xmtp.android.library.toHex class GroupWrapper { companion object { - fun encodeToObj(client: Client, group: Group, id: String): Map { + fun encodeToObj(client: Client, group: Group): Map { return mapOf( "clientAddress" to client.address, - "id" to id, + "id" to group.id.toHex(), "createdAt" to group.createdAt.time, "peerAddresses" to group.memberAddresses(), "version" to "GROUP", - "topic" to id + "topic" to group.id.toHex() ) }