mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
feat: Adds Request user info (#1279)
* Request user info * safe calls * Fix: Ensure NodeInfo is sent when requesting user info The `requestUserInfo` function now correctly sends `NodeInfo` when requesting user info by using the ` toNodeInfo()` method on `ourNodeInfo`. This ensures the recipient receives the necessary information. * fix: remove unused parameters, use service's node db for our node entity --------- Co-authored-by: musznik <bymucha@gmail.com>
This commit is contained in:
parent
83c3b484ad
commit
f944a236ac
6 changed files with 37 additions and 5 deletions
|
|
@ -1928,7 +1928,18 @@ class MeshService : Service(), Logging {
|
|||
removeByNodenum = nodeNum
|
||||
})
|
||||
}
|
||||
|
||||
override fun requestUserInfo( destNum: Int ) = toRemoteExceptions {
|
||||
if (destNum != myNodeNum) {
|
||||
sendToRadio(newMeshPacketTo(destNum
|
||||
).buildMeshPacket(
|
||||
channel = nodeDBbyNodeNum[destNum]?.channel ?: 0
|
||||
) {
|
||||
portnumValue = Portnums.PortNum.NODEINFO_APP_VALUE
|
||||
wantResponse = true
|
||||
payload = nodeDBbyNodeNum[myNodeNum]!!.user.toByteString()
|
||||
})
|
||||
}
|
||||
}
|
||||
override fun requestPosition(destNum: Int, position: Position) = toRemoteExceptions {
|
||||
sendToRadio(newMeshPacketTo(destNum).buildMeshPacket(
|
||||
channel = nodeDBbyNodeNum[destNum]?.channel ?: 0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue