Skip to content

Commit

Permalink
Fix status show intent and handling of intent failure (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
AIIX authored Mar 3, 2020
1 parent 7c700be commit 07d8c0e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions import/mycroftcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 07d8c0e

Please sign in to comment.