mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-25 10:45:21 +00:00
wip fix ack
This commit is contained in:
@@ -64,7 +64,7 @@ class BluetoothMeshService(private val context: Context) {
|
|||||||
|
|
||||||
// Wire up PacketProcessor reference for recursive handling in MessageHandler
|
// Wire up PacketProcessor reference for recursive handling in MessageHandler
|
||||||
messageHandler.packetProcessor = packetProcessor
|
messageHandler.packetProcessor = packetProcessor
|
||||||
// startPeriodicDebugLogging()
|
startPeriodicDebugLogging()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.bitchat.android.model
|
package com.bitchat.android.model
|
||||||
|
|
||||||
import android.os.Parcelable
|
import android.os.Parcelable
|
||||||
|
import com.google.gson.GsonBuilder
|
||||||
import kotlinx.parcelize.Parcelize
|
import kotlinx.parcelize.Parcelize
|
||||||
import java.nio.ByteBuffer
|
import java.nio.ByteBuffer
|
||||||
import java.nio.ByteOrder
|
import java.nio.ByteOrder
|
||||||
@@ -351,12 +352,16 @@ data class DeliveryAck(
|
|||||||
val recipientID: String,
|
val recipientID: String,
|
||||||
val recipientNickname: String,
|
val recipientNickname: String,
|
||||||
val timestamp: Date = Date(),
|
val timestamp: Date = Date(),
|
||||||
val hopCount: UByte
|
val hopCount: UInt
|
||||||
) : Parcelable {
|
) : Parcelable {
|
||||||
|
|
||||||
|
private val gson = GsonBuilder()
|
||||||
|
.setDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'")
|
||||||
|
.create()
|
||||||
|
|
||||||
fun encode(): ByteArray? {
|
fun encode(): ByteArray? {
|
||||||
return try {
|
return try {
|
||||||
com.google.gson.Gson().toJson(this).toByteArray(Charsets.UTF_8)
|
gson.toJson(this).toByteArray(Charsets.UTF_8)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user