mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-25 03:45:21 +00:00
messages working
This commit is contained in:
@@ -487,9 +487,6 @@ class BluetoothMeshService(private val context: Context) {
|
||||
|
||||
message.toBinaryPayload()?.let { messageData ->
|
||||
try {
|
||||
// Pad the message data
|
||||
val blockSize = MessagePadding.optimalBlockSize(messageData.size)
|
||||
val paddedData = MessagePadding.pad(messageData, blockSize)
|
||||
|
||||
// Create inner packet with the padded message data
|
||||
val innerPacket = BitchatPacket(
|
||||
@@ -497,7 +494,7 @@ class BluetoothMeshService(private val context: Context) {
|
||||
senderID = hexStringToByteArray(myPeerID),
|
||||
recipientID = hexStringToByteArray(recipientPeerID),
|
||||
timestamp = System.currentTimeMillis().toULong(),
|
||||
payload = paddedData,
|
||||
payload = messageData,
|
||||
signature = null,
|
||||
ttl = MAX_TTL
|
||||
)
|
||||
|
||||
@@ -67,7 +67,6 @@ class BluetoothPacketBroadcaster(
|
||||
characteristic: BluetoothGattCharacteristic?
|
||||
) {
|
||||
val packet = routed.packet
|
||||
val data = packet.toBinaryData() ?: return
|
||||
// Check if we need to fragment
|
||||
if (fragmentManager != null) {
|
||||
val fragments = fragmentManager.createFragments(packet)
|
||||
|
||||
Reference in New Issue
Block a user