mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
parent
442066d64c
commit
c3ec67a9ba
2 changed files with 13 additions and 4 deletions
|
|
@ -223,10 +223,17 @@ class MeshService : Service(), Logging {
|
|||
startPacketQueue()
|
||||
}
|
||||
|
||||
private fun updateMessageNotification(message: DataPacket) =
|
||||
serviceNotifications.updateMessageNotification(
|
||||
getSenderName(message), message.bytes!!.decodeToString()
|
||||
)
|
||||
private fun updateMessageNotification(dataPacket: DataPacket) {
|
||||
val message: String = when (dataPacket.dataType) {
|
||||
Portnums.PortNum.TEXT_MESSAGE_APP_VALUE -> dataPacket.text!!
|
||||
Portnums.PortNum.WAYPOINT_APP_VALUE -> {
|
||||
getString(R.string.waypoint_received, dataPacket.waypoint!!.name)
|
||||
}
|
||||
|
||||
else -> return
|
||||
}
|
||||
serviceNotifications.updateMessageNotification(getSenderName(dataPacket), message)
|
||||
}
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
|
|
@ -625,6 +632,7 @@ class MeshService : Service(), Logging {
|
|||
// Validate locked Waypoints from the original sender
|
||||
if (u.lockedTo != 0 && u.lockedTo != packet.from) return
|
||||
rememberDataPacket(dataPacket)
|
||||
if (u.expire > currentSecond()) updateMessageNotification(dataPacket)
|
||||
}
|
||||
|
||||
// Handle new style position info
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue