mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-26 12:25:25 +00:00
peer ID hex
This commit is contained in:
@@ -8,6 +8,7 @@ import com.bitchat.android.model.ReadReceipt
|
|||||||
import com.bitchat.android.model.RoutedPacket
|
import com.bitchat.android.model.RoutedPacket
|
||||||
import com.bitchat.android.protocol.BitchatPacket
|
import com.bitchat.android.protocol.BitchatPacket
|
||||||
import com.bitchat.android.protocol.MessageType
|
import com.bitchat.android.protocol.MessageType
|
||||||
|
import com.bitchat.android.util.toHexString
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
import org.json.JSONObject
|
import org.json.JSONObject
|
||||||
import java.security.MessageDigest
|
import java.security.MessageDigest
|
||||||
@@ -199,12 +200,12 @@ class MessageHandler(private val myPeerID: String) {
|
|||||||
val recipientID = packet.recipientID?.takeIf { !it.contentEquals(delegate?.getBroadcastRecipient()) }
|
val recipientID = packet.recipientID?.takeIf { !it.contentEquals(delegate?.getBroadcastRecipient()) }
|
||||||
var recipientIDString = ""
|
var recipientIDString = ""
|
||||||
if (recipientID != null) {
|
if (recipientID != null) {
|
||||||
recipientIDString = String(recipientID).replace("\u0000", "")
|
recipientIDString = recipientID.toHexString()
|
||||||
}
|
}
|
||||||
if (recipientID == null) {
|
if (recipientID == null) {
|
||||||
// BROADCAST MESSAGE
|
// BROADCAST MESSAGE
|
||||||
handleBroadcastMessage(routed)
|
handleBroadcastMessage(routed)
|
||||||
} else if (recipientIDString == myPeerID) {
|
} else if (recipientID.toHexString() == myPeerID) {
|
||||||
// PRIVATE MESSAGE FOR US
|
// PRIVATE MESSAGE FOR US
|
||||||
handlePrivateMessage(packet, peerID)
|
handlePrivateMessage(packet, peerID)
|
||||||
} else if (packet.ttl > 0u) {
|
} else if (packet.ttl > 0u) {
|
||||||
|
|||||||
Reference in New Issue
Block a user