summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--message.h10
-rw-r--r--network/network.cpp4
-rw-r--r--network/network.h1
3 files changed, 15 insertions, 0 deletions
diff --git a/message.h b/message.h
index 0a01e17..c89f007 100644
--- a/message.h
+++ b/message.h
@@ -70,6 +70,11 @@ class Message : public QObject
return m_event_data;
}
+ inline QString replyStatus() const
+ {
+ return m_reply_status;
+ }
+
inline QString replyInfo() const
{
return m_reply_info;
@@ -99,6 +104,11 @@ class Message : public QObject
m_request["callid"] = callId;
}
+ inline QMap<QString, QVariant> requestData() const
+ {
+ return m_request;
+ }
+
protected:
bool m_event, m_init, m_reply;
QString m_event_api, m_event_name, m_reply_info, m_reply_status, m_reply_uuid;
diff --git a/network/network.cpp b/network/network.cpp
index 53a4898..dc5fa5f 100644
--- a/network/network.cpp
+++ b/network/network.cpp
@@ -298,6 +298,10 @@ void Network::processReply(ResponseMessage *rmsg)
addServices(rmsg->replyData().value("values").toArray());
} else if (rmsg->requestVerb() == "technologies") {
parseTechnologies(rmsg->replyData().value("values").toArray());
+ } else if (rmsg->requestVerb() == "connect_service") {
+ if (rmsg->replyStatus() == "failed" && rmsg->replyInfo().contains("invalid-key")) {
+ emit invalidPassphrase(rmsg->requestData()["parameter"].toMap()["service"].toString());
+ }
}
}
diff --git a/network/network.h b/network/network.h
index a3fd3fb..0c0418b 100644
--- a/network/network.h
+++ b/network/network.h
@@ -52,6 +52,7 @@ class Network : public QObject
signals:
void inputRequest(int id);
+ void invalidPassphrase(QString service);
void searchResults(QString name);
void statusChanged(bool connected);
void wifiConnectedChanged(bool connected);