Skip to content

Commit

Permalink
🐛 Fix preKeyBundle interface
Browse files Browse the repository at this point in the history
  • Loading branch information
guiyanakuang committed Feb 9, 2024
1 parent 48c3993 commit 5e54314
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder
import org.signal.libsignal.protocol.state.PreKeyBundle

object PreKeyBundleSerializer : KSerializer<PreKeyBundle> {
object PreKeyBundleSerializer: KSerializer<PreKeyBundle> {

override val descriptor: SerialDescriptor = buildClassSerialDescriptor("PreKeyBundle") {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.clipevery.net.clientapi

import com.clipevery.dto.sync.DataContent
import com.clipevery.net.ClipClient
import com.clipevery.utils.decodePreKeyBundle
import io.github.oshai.kotlinlogging.KotlinLogging
import io.ktor.client.call.body
import io.ktor.http.URLBuilder
Expand All @@ -20,7 +21,7 @@ class DesktopSyncClientApi(private val clipClient: ClipClient): SyncClientApi {
if (response.status.value != 200) {
return null
}
return response.body<PreKeyBundle>()
return decodePreKeyBundle(response.body<DataContent>().data)
} catch (e: Exception) {
logger.error(e) { "getPreKeyBundle error" }
}
Expand Down

0 comments on commit 5e54314

Please sign in to comment.