mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-03-31 12:11:15 -04:00
revert broadcastMessageStatus
This commit is contained in:
@@ -92,6 +92,7 @@ class MeshService : Service(), Logging {
|
||||
|
||||
const val ACTION_NODE_CHANGE = "$prefix.NODE_CHANGE"
|
||||
const val ACTION_MESH_CONNECTED = "$prefix.MESH_CONNECTED"
|
||||
const val ACTION_MESSAGE_STATUS = "$prefix.MESSAGE_STATUS"
|
||||
|
||||
open class NodeNotFoundException(reason: String) : Exception(reason)
|
||||
class InvalidNodeIdException : NodeNotFoundException("Invalid NodeId")
|
||||
@@ -833,6 +834,7 @@ class MeshService : Service(), Logging {
|
||||
serviceScope.handledLaunch {
|
||||
packetRepository.get().updateMessageStatus(p, m)
|
||||
}
|
||||
serviceBroadcasts.broadcastMessageStatus(p)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.geeksville.mesh.service
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Parcelable
|
||||
import com.geeksville.mesh.DataPacket
|
||||
import com.geeksville.mesh.NodeInfo
|
||||
|
||||
@@ -37,6 +38,20 @@ class MeshServiceBroadcasts(
|
||||
explicitBroadcast(intent)
|
||||
}
|
||||
|
||||
fun broadcastMessageStatus(p: DataPacket) {
|
||||
if (p.id == 0) {
|
||||
MeshService.debug("Ignoring anonymous packet status")
|
||||
} else {
|
||||
// Do not log, contains PII possibly
|
||||
// MeshService.debug("Broadcasting message status $p")
|
||||
val intent = Intent(MeshService.ACTION_MESSAGE_STATUS).apply {
|
||||
putExtra(EXTRA_PACKET_ID, p.id)
|
||||
putExtra(EXTRA_STATUS, p.status as Parcelable)
|
||||
}
|
||||
explicitBroadcast(intent)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Broadcast our current connection status
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user