fix(peer-client): plumb peer_id through Satellite talker paths

Satellite{Link,Client}::handleMsgPeerTalkerStart was calling
setTrunkTalkerForTG without recording peer_id, so the
trunkTalkerUpdated signal fired with peer_id="" and the new
peer/<id>/talker/<tg>/start MQTT topic became peer//talker/...
(malformed empty segment).

Use setTrunkTalkerForTGViaPeer with m_satellite_id / m_parent_id
so the topic is properly namespaced.

Also add a defensive early-return in MqttPublisher::onPeerTalker*
that logs a warning and skips the publish if peer_id is empty —
protects against future callers that emit signals without peer
attribution (e.g. TwinLink, addressed in Task 7).
This commit is contained in:
Audric committed 2026-04-28 19:59:32 +02:00
1 parent af746d7534
commit 1bb847b3c8
3 files changed
+16 -2

No files matched your search

+2 -1
View File
@@ -340,7 +340,8 @@ void SatelliteClient::handleMsgPeerTalkerStart(std::istream& is)
// Register as trunk talker — fires trunkTalkerUpdated which
// broadcasts MsgTalkerStart to local clients
TGHandler::instance()->setTrunkTalkerForTG(msg.tg(), msg.callsign());
TGHandler::instance()->setTrunkTalkerForTGViaPeer(msg.tg(), msg.callsign(),
m_parent_id);
} /* SatelliteClient::handleMsgPeerTalkerStart */