dont cache key
This commit is contained in:
parent
6e0ac042d0
commit
3044dbff33
|
@ -17,7 +17,11 @@ Toasty::~Toasty()
|
||||||
|
|
||||||
void Toasty::slotNotify(Notification notification)
|
void Toasty::slotNotify(Notification notification)
|
||||||
{
|
{
|
||||||
QNetworkRequest request(QString("http://api.supertoasty.com/notify/%1").arg(m_key));
|
QString key = value("DeviceID").toString();
|
||||||
|
if (key.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
QNetworkRequest request(QString("http://api.supertoasty.com/notify/%1").arg(key));
|
||||||
QHttpMultiPart *mp = new QHttpMultiPart(QHttpMultiPart::FormDataType);
|
QHttpMultiPart *mp = new QHttpMultiPart(QHttpMultiPart::FormDataType);
|
||||||
QHttpPart title;
|
QHttpPart title;
|
||||||
title.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"title\""));
|
title.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"title\""));
|
||||||
|
@ -65,9 +69,7 @@ bool Toasty::initialize(SnoreCore *snore)
|
||||||
{
|
{
|
||||||
if (SnoreSecondaryBackend::initialize(snore)) {
|
if (SnoreSecondaryBackend::initialize(snore)) {
|
||||||
setDefaultValue("DeviceID", "", "The ID provided for your device by Toasty");
|
setDefaultValue("DeviceID", "", "The ID provided for your device by Toasty");
|
||||||
m_key = value("DeviceID").toString();
|
return true;
|
||||||
snoreDebug(SNORE_DEBUG) << m_key << !m_key.isEmpty();
|
|
||||||
return !m_key.isEmpty();
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,6 @@ public slots:
|
||||||
virtual void slotNotify(Snore::Notification notification) override;
|
virtual void slotNotify(Snore::Notification notification) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_key;
|
|
||||||
QNetworkAccessManager m_manager;
|
QNetworkAccessManager m_manager;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue