mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix #204 - throw error if sent message is too long
This commit is contained in:
parent
6e2cb723ea
commit
5007019a2e
2 changed files with 6 additions and 1 deletions
|
|
@ -1458,6 +1458,11 @@ class MeshService : Service(), Logging {
|
|||
// Keep a record of datapackets, so GUIs can show proper chat history
|
||||
rememberDataPacket(p)
|
||||
|
||||
if(p.bytes.size >= MeshProtos.Constants.DATA_PAYLOAD_LEN.number) {
|
||||
p.status = MessageStatus.ERROR
|
||||
throw RemoteException("Message too long")
|
||||
}
|
||||
|
||||
if (p.id != 0) { // If we have an ID we can wait for an ack or nak
|
||||
deleteOldPackets()
|
||||
sentPackets[p.id] = p
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue