mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Fix: hoplimit of dms would always fallback to hops away of the node even when configured hops was higher (#1495)
* fix hops setting in dms * Fix hops for exchange position * Final fix
This commit is contained in:
parent
0f90d8497a
commit
ec5dfd5ae3
3 changed files with 5 additions and 3 deletions
|
|
@ -350,7 +350,7 @@ extension AccessoryManager {
|
|||
if toUserNum > 0 {
|
||||
meshPacket.to = UInt32(toUserNum)
|
||||
let hopsAway = newMessage.toUser?.userNode?.hopsAway ?? 0
|
||||
if hopsAway > Int32(truncatingIfNeeded: newMessage.toUser?.userNode?.loRaConfig?.hopLimit ?? 0) {
|
||||
if hopsAway > Int32(truncatingIfNeeded: newMessage.fromUser?.userNode?.loRaConfig?.hopLimit ?? 0) {
|
||||
meshPacket.hopLimit = UInt32(truncatingIfNeeded: hopsAway)
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import SwiftUI
|
|||
|
||||
struct ExchangePositionsButton: View {
|
||||
var node: NodeInfoEntity
|
||||
var connectedNode: NodeInfoEntity
|
||||
|
||||
@EnvironmentObject var accessoryManager: AccessoryManager
|
||||
|
||||
|
|
@ -10,7 +11,7 @@ struct ExchangePositionsButton: View {
|
|||
@State private var isPresentingPositionFailedAlert: Bool = false
|
||||
|
||||
var body: some View {
|
||||
let hopsAway = Int32(truncatingIfNeeded: node.hopsAway > node.loRaConfig?.hopLimit ?? 0 ? node.hopsAway : node.loRaConfig?.hopLimit ?? 0)
|
||||
let hopsAway = Int32(truncatingIfNeeded: node.hopsAway > connectedNode.loRaConfig?.hopLimit ?? 0 ? node.hopsAway : connectedNode.loRaConfig?.hopLimit ?? 0)
|
||||
Button {
|
||||
Task {
|
||||
do {
|
||||
|
|
|
|||
|
|
@ -460,7 +460,8 @@ struct NodeDetail: View {
|
|||
}
|
||||
}
|
||||
ExchangePositionsButton(
|
||||
node: node
|
||||
node: node,
|
||||
connectedNode: connectedNode
|
||||
)
|
||||
TraceRouteButton(
|
||||
node: node
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue