summaryrefslogtreecommitdiffstats
path: root/voice/voice.cpp
diff options
context:
space:
mode:
authorRaquel Medina <raquel.medina@konsulko.com>2019-12-12 15:37:24 +0100
committerRaquel Medina <raquel.medina@konsulko.com>2019-12-12 15:38:27 +0100
commit9f3896cb82c27e912bc37ae88254367911050512 (patch)
tree83cffa219dfb2b6acc2dd84ced212d41055bc365 /voice/voice.cpp
parent0ff12f7c22e2be3238b0c436c08634cd18f5bd06 (diff)
voice: register for all vshl events on start up
libqtappfw should register for login events from start up (along with other vshl events), so that the information is available even if an user didnt kick start the authorization process via settings app. - register to all vshl events on start up; - rename 'subscribeToLoginEvents' to 'triggerCBLProcess', which is indeed the operation implemented behind this method. Bug-AGL: SPEC-2981 Signed-off-by: Raquel Medina <raquel.medina@konsulko.com> Change-Id: I8aea5cac0b6d17b8ca3838d0958d2128cc745c0f
Diffstat (limited to 'voice/voice.cpp')
-rw-r--r--voice/voice.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/voice/voice.cpp b/voice/voice.cpp
index 2a83c94..f200b95 100644
--- a/voice/voice.cpp
+++ b/voice/voice.cpp
@@ -45,7 +45,7 @@ Voice::~Voice()
void Voice::scan()
{
- VoiceMessage *vmsg = new VoiceMessage();
+ VoiceMessage *vmsg = new VoiceMessage();
QJsonObject parameter;
vmsg->createRequest("enumerateVoiceAgents", parameter);
@@ -55,13 +55,13 @@ void Voice::scan()
void Voice::getCBLpair(QString id)
{
- subscribeAgentToLoginEvents(id);
+ triggerCBLProcess(id);
}
void Voice::subscribeAgentToVshlEvents(QString id)
{
QJsonArray events = QJsonArray::fromStringList(vshl_events);
- VoiceMessage *vmsg = new VoiceMessage();
+ VoiceMessage *vmsg = new VoiceMessage();
QJsonObject parameter;
parameter.insert("va_id", id);
@@ -74,7 +74,7 @@ void Voice::subscribeAgentToVshlEvents(QString id)
void Voice::unsubscribeAgentFromVshlEvents(QString id)
{
QJsonArray events = QJsonArray::fromStringList(vshl_events);
- VoiceMessage *vmsg = new VoiceMessage();
+ VoiceMessage *vmsg = new VoiceMessage();
QJsonObject parameter;
parameter.insert("va_id", id);
@@ -84,18 +84,15 @@ void Voice::unsubscribeAgentFromVshlEvents(QString id)
delete vmsg;
}
-void Voice::subscribeAgentToLoginEvents(QString id)
+void Voice::triggerCBLProcess(QString id)
{
- QJsonArray events = QJsonArray::fromStringList(login_events);
- VoiceMessage *vmsg = new VoiceMessage();
+ QJsonArray events;
+ VoiceMessage *vmsg = new VoiceMessage();
QJsonObject parameter;
parameter.insert("va_id", id);
parameter.insert("events", events);
vmsg->createRequest("subscribeToLoginEvents", parameter);
- m_loop->sendMessage(vmsg);
- //subscribe to events from vshl:
- vmsg->createRequest("subscribe", parameter);
m_loop->sendMessage(vmsg);
delete vmsg;
}
@@ -125,7 +122,7 @@ void Voice::processVshlEvent(VoiceMessage *vmsg)
}
if (vmsg->isAuthStateEvent()) {
const QString authstate = obj.value("state").toString();
- if (!authstate.isEmpty())
+ if (!authstate.isEmpty())
m_var->setAuthState(
agentId,
static_cast<VoiceAgentRegistry::ServiceAuthState>(