From 07d8c0ebe54250620fed5b81b601bd44d334ec5b Mon Sep 17 00:00:00 2001 From: Aditya Mehra Date: Tue, 3 Mar 2020 22:50:53 +1030 Subject: [PATCH] Fix status show intent and handling of intent failure (#41) --- import/mycroftcontroller.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/import/mycroftcontroller.cpp b/import/mycroftcontroller.cpp index daf0762..cd1b9ea 100644 --- a/import/mycroftcontroller.cpp +++ b/import/mycroftcontroller.cpp @@ -208,11 +208,21 @@ void MycroftController::onMainSocketMessageReceived(const QString &message) } #endif - if (type == QLatin1String("intent_failure")) { + // Try catching intent_failure from another method because of issue: https://github.com/MycroftAI/mycroft-core/issues/2490 + if (type == QLatin1String("active_skill_request")) { + QString skill_id = doc[QStringLiteral("data")][QStringLiteral("skill_id")].toString(); + if (skill_id == QStringLiteral("fallback-unknown.mycroftai")) { + m_isListening = false; + emit isListeningChanged(); + emit notUnderstood(); + } + return; + } + // Instead of intent_failure which is handled by fallback skills, use complete_intent_failure where all skills failed to parse intent + if (type == QLatin1String("complete_intent_failure")) { m_isListening = false; emit isListeningChanged(); emit notUnderstood(); - return; } if (type == QLatin1String("recognizer_loop:audio_output_start")) { m_isSpeaking = true; @@ -224,7 +234,7 @@ void MycroftController::onMainSocketMessageReceived(const QString &message) emit isSpeakingChanged(); return; } - if (type == QLatin1String("recognizer_loop:record_begin")) { + if (type == QLatin1String("recognizer_loop:wakeword")) { m_isListening = true; emit isListeningChanged(); return;