diff --git a/examples/companion_radio/MyMesh.cpp b/examples/companion_radio/MyMesh.cpp index 37b4fe91..55a7bd3f 100644 --- a/examples/companion_radio/MyMesh.cpp +++ b/examples/companion_radio/MyMesh.cpp @@ -882,15 +882,10 @@ void MyMesh::onChannelMessageRecv(const mesh::GroupChannel &channel, mesh::Packe // chatter is ignored. int32_t loc_lat, loc_lon; if (_ui && geo::parseLocShare(text, loc_lat, loc_lon)) { - char sender[32] = {0}; - const char* sep = strstr(text, ": "); - if (sep && sep > text) { - int n = (int)(sep - text); - if (n > (int)sizeof(sender) - 1) n = sizeof(sender) - 1; - memcpy(sender, text, n); - sender[n] = '\0'; - } - _ui->onSharedLocation(nullptr, sender[0] ? sender : "?", loc_lat, loc_lon, timestamp, false); + char sender[32]; + const char* msg; + botChannelSenderSplit(text, sender, sizeof(sender), &msg); + _ui->onSharedLocation(nullptr, sender, loc_lat, loc_lon, timestamp, false); } #endif diff --git a/examples/companion_radio/MyMeshBot.h b/examples/companion_radio/MyMeshBot.h index bb3d4e78..45e3ab81 100644 --- a/examples/companion_radio/MyMeshBot.h +++ b/examples/companion_radio/MyMeshBot.h @@ -300,7 +300,7 @@ bool MyMesh::botCommandReply(const char* cmd, const char* arg, const char* arg2, } bool on = !strcmp(arg, "on"); // arg was lowercased while parsing (see botScanCommands) bool off = !strcmp(arg, "off"); - if (!on && !off) { snprintf(out, out_len, "gps: on|off|fix?"); return true; } + if (!on && !off) { snprintf(out, out_len, "GPS: on|off|fix?"); return true; } // Deferred: applyPendingBotActions() actually flips the GPS state, once // quiet-hours/cooldown/throttle have passed (see MyMesh.h). _bot_gps_action_pending = true;