Skip to content

Commit

Permalink
get the app building
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Nov 28, 2023
1 parent 47b638a commit e3fb360
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ repositories {
dependencies {
implementation project(':expo-modules-core')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
implementation "org.xmtp:android:0.6.13"
implementation "org.xmtp:android:0.6.14"
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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,24 @@ class XMTPModule : Module() {
filename = attachment.filename
).toJson()
}
AsyncFunction("sendEncodedContent") { clientAddress: String, topic: String, encodedContentData: ByteArray ->

AsyncFunction("sendEncodedContent") { clientAddress: String, topic: String, encodedContentData: List<Int> ->
val conversation =
findConversation(
clientAddress = clientAddress,
topic = topic
) ?: throw XMTPException("no conversation found for $topic")

val encodedContent = EncodedContent.parseFrom(encodedContentData.toByteString())
val encodedContentDataBytes =
encodedContentData.foldIndexed(ByteArray(encodedContentData.size)) { i, a, v ->
a.apply {
set(
i,
v.toByte()
)
}
}
val encodedContent = EncodedContent.parseFrom(encodedContentDataBytes)

conversation.send(encodedContent = encodedContent)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package expo.modules.xmtpreactnativesdk.wrappers

import com.google.gson.GsonBuilder
import org.xmtp.android.library.codecs.description
import uniffi.xmtp_dh.org.xmtp.android.library.messages.DecryptedMessage
import org.xmtp.android.library.messages.DecryptedMessage

class DecodedMessageWrapper {

Expand Down

0 comments on commit e3fb360

Please sign in to comment.