mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
feat: allow hiding offline and/or non-direct nodes from list and map (#2052)
Co-authored-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
parent
6becdf137b
commit
e781d6774b
10 changed files with 211 additions and 16 deletions
|
|
@ -23,6 +23,7 @@ import com.geeksville.mesh.util.GPSFormat
|
|||
import com.geeksville.mesh.util.bearing
|
||||
import com.geeksville.mesh.util.latLongToMeter
|
||||
import com.geeksville.mesh.util.anonymize
|
||||
import com.geeksville.mesh.util.onlineTimeThreshold
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
||||
//
|
||||
|
|
@ -202,9 +203,7 @@ data class NodeInfo(
|
|||
*/
|
||||
val isOnline: Boolean
|
||||
get() {
|
||||
val now = System.currentTimeMillis() / 1000
|
||||
val timeout = 15 * 60
|
||||
return (now - lastHeard <= timeout)
|
||||
return lastHeard > onlineTimeThreshold()
|
||||
}
|
||||
|
||||
/// return the position if it is valid, else null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue