fix: PKC channel index in sent `MeshPacket`s

pull/1276/head
andrekir 2024-09-30 15:27:55 -03:00
rodzic cec234b58a
commit bfa2eaef11
1 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -516,16 +516,17 @@ class MeshService : Service(), Logging {
this.wantAck = wantAck
this.id = id
this.hopLimit = hopLimit
this.channel = channel
this.priority = priority
decoded = MeshProtos.Data.newBuilder().also {
initFn(it)
}.build()
if (channel == DataPacket.PKC_CHANNEL_INDEX) {
pkiEncrypted = true
nodeDBbyNodeNum[to]?.user?.publicKey?.let { publicKey ->
pkiEncrypted = !publicKey.isEmpty
this.publicKey = publicKey
}
} else {
this.channel = channel
}
return build()