Fix: do not reject empty packets that arent message type (#510)

* do not reject empty packets that arent message type

* leave message with empty byte array

* clean up comments
This commit is contained in:
callebtc
2025-11-03 20:37:31 +01:00
committed by GitHub
parent cf53c65cfe
commit 282ac0fe5a
2 changed files with 2 additions and 16 deletions
@@ -949,12 +949,11 @@ class BluetoothMeshService(private val context: Context) {
* Send leave announcement
*/
private fun sendLeaveAnnouncement() {
val nickname = delegate?.getNickname() ?: myPeerID
val packet = BitchatPacket(
type = MessageType.LEAVE.value,
ttl = MAX_TTL,
senderID = myPeerID,
payload = nickname.toByteArray()
payload = byteArrayOf()
)
// Sign the packet before broadcasting