From 16c4429c177a4eb9943e5b9e3c945be76a4fee70 Mon Sep 17 00:00:00 2001 From: Raquel Medina Date: Wed, 4 Dec 2019 03:57:14 +0100 Subject: voice: add status events to VshlCoreVoiceMessages. - Add connection, auth and dialog status events to VshlCoreVoiceMessage private events list. - Fix logic error in AlexaVoiceMessage's auth events processing. Error introduced by commit 'da091649e775b23a35eb88df1c2cf9ce3fb350f7'. Bug-AGL: SPEC-2880 Signed-off-by: Raquel Medina Change-Id: Ia402c8307b16595be5a8f9a1ed79d5eeb0e08036 --- voice/voicemessage.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/voice/voicemessage.h b/voice/voicemessage.h index 1de5dd2..00ed847 100644 --- a/voice/voicemessage.h +++ b/voice/voicemessage.h @@ -36,11 +36,11 @@ class VshlCoreVoiceMessage : public VoiceMessage public: virtual ~VshlCoreVoiceMessage() {}; bool isAuthStateEvent() const override { - return (this->eventName() == "voice_authstate_event"); }; + return (this->eventName().contains("voice_authstate_event")); }; bool isConnectionStateEvent() const override { - return (this->eventName() == "voice_connectionstate_event"); }; + return (this->eventName().contains("voice_connectionstate_event")); }; bool isDialogStateEvent() const override { - return (this->eventName() == "voice_dialogstate_event"); }; + return (this->eventName().contains("voice_dialogstate_event")); }; bool createRequest(QString verb, QJsonObject parameter) override; private: @@ -53,7 +53,9 @@ class VshlCoreVoiceMessage : public VoiceMessage "setDefaultVoiceAgent", }; QStringList events { - "", + "voice_authstate_event", + "voice_dialogstate_event", + "voice_connectionstate_event", }; }; @@ -94,7 +96,7 @@ class AlexaVoiceMessage : public VoiceMessage public: virtual ~AlexaVoiceMessage() {}; bool isAuthStateEvent() const override { - return (!events.contains(this->eventName())); }; + return (events.contains(this->eventName())); }; bool isConnectionStateEvent() const override { return false; }; bool isDialogStateEvent() const override { return false; }; bool createRequest(QString verb, QJsonObject parameter) override; -- cgit 1.2.3-korg