aboutsummaryrefslogtreecommitdiff
path: root/src/helpers/BaseChatMesh.cpp
diff options
context:
space:
mode:
authorScott Powell <sqij@protonmail.com>2025-07-31 13:04:16 +1000
committerScott Powell <sqij@protonmail.com>2025-07-31 13:04:16 +1000
commitfcdf342db69de7f1700874ded2c502517455da89 (patch)
treee3bfe0cd0126120d91b4d64385c77093233cabf4 /src/helpers/BaseChatMesh.cpp
parentf87e856347e8047ba3ce01bdad77ae92418f5088 (diff)
* Companion: experimental CMD_SEND_DISCOVERY_REQ -> PUSH_CODE_DISCOVERY_RESPONSE
Diffstat (limited to 'src/helpers/BaseChatMesh.cpp')
-rw-r--r--src/helpers/BaseChatMesh.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/helpers/BaseChatMesh.cpp b/src/helpers/BaseChatMesh.cpp
index 476e6e8f..60366c65 100644
--- a/src/helpers/BaseChatMesh.cpp
+++ b/src/helpers/BaseChatMesh.cpp
@@ -235,9 +235,13 @@ bool BaseChatMesh::onPeerPathRecv(mesh::Packet* packet, int sender_idx, const ui
ContactInfo& from = contacts[i];
- // NOTE: for this impl, we just replace the current 'out_path' regardless, whenever sender sends us a new out_path.
+ return onContactPathRecv(from, packet->path, packet->path_len, path, path_len, extra_type, extra, extra_len);
+}
+
+bool BaseChatMesh::onContactPathRecv(ContactInfo& from, uint8_t* in_path, uint8_t in_path_len, uint8_t* out_path, uint8_t out_path_len, uint8_t extra_type, uint8_t* extra, uint8_t extra_len) {
+ // NOTE: default impl, we just replace the current 'out_path' regardless, whenever sender sends us a new out_path.
// FUTURE: could store multiple out_paths per contact, and try to find which is the 'best'(?)
- memcpy(from.out_path, path, from.out_path_len = path_len); // store a copy of path, for sendDirect()
+ memcpy(from.out_path, out_path, from.out_path_len = out_path_len); // store a copy of path, for sendDirect()
from.lastmod = getRTCClock()->getCurrentTime();
onContactPathUpdated(from);