From e1b7d61b6fc6426c0a68874485a6d0c6776a3322 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Thu, 16 Apr 2020 11:57:25 +0200 Subject: [PATCH] Vehicle: fix removal of hashtag in statustext This fixes a bug where a URL containing a hashtag (#) was displayed without the hashtag. --- src/Vehicle/Vehicle.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc index a3b551805..bd5070ce1 100644 --- a/src/Vehicle/Vehicle.cc +++ b/src/Vehicle/Vehicle.cc @@ -1000,8 +1000,17 @@ void Vehicle::_chunkedStatusTextCompleted(uint8_t compId) // If the message is NOTIFY or higher severity, or starts with a '#', // then read it aloud. - if (messageText.startsWith("#") || severity <= MAV_SEVERITY_NOTICE) { + bool readAloud = false; + + if (messageText.startsWith("#")) { messageText.remove("#"); + readAloud = true; + } + else if (severity <= MAV_SEVERITY_NOTICE) { + readAloud = true; + } + + if (readAloud) { if (!skipSpoken) { qgcApp()->toolbox()->audioOutput()->say(messageText); } -- 2.22.0