diff --git a/src/TaskRouter.cpp b/src/TaskRouter.cpp index db3b811..09afb91 100644 --- a/src/TaskRouter.cpp +++ b/src/TaskRouter.cpp @@ -35,17 +35,20 @@ bool RouterTask::setup(System &system) { bool RouterTask::loop(System &system) { // do routing if (!_fromModem.empty()) { - std::shared_ptr msg = _fromModem.getElement(); - String path = msg->getPath(); + std::shared_ptr modemMsg = _fromModem.getElement(); - if (!(path.indexOf("RFONLY") != -1 || path.indexOf("NOGATE") != -1 || path.indexOf("TCPIP") != -1)) { - if (!path.isEmpty()) { - path += ","; - } - msg->setPath(path + "qAR," + system.getUserConfig()->callsign); + if (system.getUserConfig()->aprs_is.active && modemMsg->getSource() != system.getUserConfig()->callsign) { + std::shared_ptr msg = std::make_shared(*modemMsg); + String path = msg->getPath(); - if (system.getUserConfig()->aprs_is.active) + if (!(path.indexOf("RFONLY") != -1 || path.indexOf("NOGATE") != -1 || path.indexOf("TCPIP") != -1)) { + if (!path.isEmpty()) { + path += ","; + } + + msg->setPath(path + "qAR," + system.getUserConfig()->callsign); _toAprsIs.addElement(msg); + } } }