fix broadcastMessageStatus (#535)

pull/537/head
Andre K 2022-12-10 00:14:32 -03:00 zatwierdzone przez GitHub
rodzic dcc03be484
commit 6ede4ed3bd
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 10 dodań i 9 usunięć

Wyświetl plik

@ -837,7 +837,7 @@ class MeshService : Service(), Logging {
serviceScope.handledLaunch {
packetRepository.get().updateMessageStatus(p, m)
}
serviceBroadcasts.broadcastMessageStatus(p)
serviceBroadcasts.broadcastMessageStatus(p.copy(status = m))
}
/**
@ -1628,19 +1628,11 @@ class MeshService : Service(), Logging {
if (p.dataType == 0)
throw Exception("Port numbers must be non-zero!") // we are now more strict
// 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
}
// If radio is sleeping or disconnected, queue the packet
when (connectionState) {
ConnectionState.CONNECTED ->
@ -1654,6 +1646,15 @@ class MeshService : Service(), Logging {
else -> // sleeping or disconnected
enqueueForSending(p)
}
serviceBroadcasts.broadcastMessageStatus(p)
// Keep a record of datapackets, so GUIs can show proper chat history
rememberDataPacket(p)
if (p.id != 0) { // If we have an ID we can wait for an ack or nak
deleteOldPackets()
sentPackets[p.id] = p
}
GeeksvilleApplication.analytics.track(
"data_send",