Skip to content

Commit

Permalink
update to the latest ios and android sdks
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Oct 26, 2023
1 parent d8f545f commit 409fc0a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 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.6"
implementation "org.xmtp:android:0.6.7"
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 @@ -21,9 +21,9 @@ import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
import kotlinx.coroutines.suspendCancellableCoroutine
import org.json.JSONObject
import org.xmtp.android.library.AllowState
import org.xmtp.android.library.Client
import org.xmtp.android.library.ClientOptions
import org.xmtp.android.library.ConsentState
import org.xmtp.android.library.Conversation
import org.xmtp.android.library.PreparedMessage
import org.xmtp.android.library.SendOptions
Expand Down Expand Up @@ -514,16 +514,16 @@ class XMTPModule : Module() {

AsyncFunction("refreshConsentList") { clientAddress: String ->
val client = clients[clientAddress] ?: throw XMTPException("No client")
client.contacts.refreshAllowList()
client.contacts.refreshConsentList()
}

AsyncFunction("conversationConsentState") { clientAddress: String, conversationTopic: String ->
val conversation = findConversation(clientAddress, conversationTopic)
?: throw XMTPException("no conversation found for $conversationTopic")
when (conversation.allowState()) {
AllowState.ALLOW -> "allowed"
AllowState.BLOCK -> "blocked"
AllowState.UNKNOWN -> "unknown"
when (conversation.consentState()) {
ConsentState.ALLOWED -> "allowed"
ConsentState.BLOCKED -> "blocked"
ConsentState.UNKNOWN -> "unknown"
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -415,15 +415,15 @@ PODS:
- GenericJSON (~> 2.0)
- Logging (~> 1.0.0)
- secp256k1.swift (~> 0.1)
- XMTP (0.6.2-alpha0):
- XMTP (0.6.3-alpha0):
- Connect-Swift
- GzipSwift
- web3.swift
- XMTPRust (= 0.3.6-beta0)
- XMTPReactNative (0.1.0):
- ExpoModulesCore
- MessagePacker
- XMTP (= 0.6.2-alpha0)
- XMTP (= 0.6.3-alpha0)
- XMTPRust (0.3.6-beta0)
- Yoga (1.14.0)

Expand Down Expand Up @@ -680,8 +680,8 @@ SPEC CHECKSUMS:
secp256k1.swift: a7e7a214f6db6ce5db32cc6b2b45e5c4dd633634
SwiftProtobuf: bcfd2bc231cf9ae552cdc7c4e877bd3b41fe57b1
web3.swift: 2263d1e12e121b2c42ffb63a5a7beb1acaf33959
XMTP: cdc893b31f190f0565aad0bfe01e8d75562fbb53
XMTPReactNative: fae42c24d34e2eb98d91910fe6ec14f365018b2f
XMTP: 3181e5c8e9d9885a97e5c5b22ac523bf9a713656
XMTPReactNative: 27185719aae360bc307cc6faf7bcf879cf681d97
XMTPRust: 3c958736a4f4ee798e425b5644551f1c948da4b0
Yoga: 065f0b74dba4832d6e328238de46eb72c5de9556

Expand Down
4 changes: 2 additions & 2 deletions ios/XMTPModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -549,14 +549,14 @@ public class XMTPModule: Module {
guard let client = await clientsManager.getClient(key: clientAddress) else {
throw Error.noClient
}
try await client.contacts.refreshAllowList()
try await client.contacts.refreshConsentList()
}

AsyncFunction("conversationConsentState") { (clientAddress: String, conversationTopic: String) -> String in
guard let conversation = try await findConversation(clientAddress: clientAddress, topic: conversationTopic) else {
throw Error.conversationNotFound(conversationTopic)
}
switch (await conversation.allowState()) {
switch (await conversation.consentState()) {
case .allowed: return "allowed"
case .blocked: return "blocked"
case .unknown: return "unknown"
Expand Down
2 changes: 1 addition & 1 deletion ios/XMTPReactNative.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ Pod::Spec.new do |s|

s.source_files = "**/*.{h,m,swift}"
s.dependency "MessagePacker"
s.dependency "XMTP", "= 0.6.2-alpha0"
s.dependency "XMTP", "= 0.6.3-alpha0"
end

0 comments on commit 409fc0a

Please sign in to comment.