From f243d383e474e33b908493f687d2b8d8807f2385 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Thu, 20 Sep 2018 00:04:44 +0200 Subject: [PATCH] Revert "add a hack for meeting the zapf deadline" This reverts commit 8df8d70535e08dcc949e7839f216a8a48bcb9f54. --- libnymea-core/cloud/awsconnector.cpp | 4 +-- libnymea-core/cloud/cloudnotifications.cpp | 33 +--------------------- 2 files changed, 2 insertions(+), 35 deletions(-) diff --git a/libnymea-core/cloud/awsconnector.cpp b/libnymea-core/cloud/awsconnector.cpp index cd1c2e72..338a77cb 100644 --- a/libnymea-core/cloud/awsconnector.cpp +++ b/libnymea-core/cloud/awsconnector.cpp @@ -266,9 +266,7 @@ int AWSConnector::sendPushNotification(const QString &userId, const QString &end params.insert("title", title); params.insert("body", text); params.insert("timestamp", QDateTime::currentMSecsSinceEpoch()); -// publish(QString("%1/notify/user/%2/%3").arg(m_clientId, userId, endpointId), params); - Q_UNUSED(userId) - publish(QString("%1/notify/user/%2").arg(m_clientId, endpointId), params); + publish(QString("%1/notify/user/%2/%3").arg(m_clientId, userId, endpointId), params); return m_transactionId; } diff --git a/libnymea-core/cloud/cloudnotifications.cpp b/libnymea-core/cloud/cloudnotifications.cpp index 7f0363d4..eb33f8b7 100644 --- a/libnymea-core/cloud/cloudnotifications.cpp +++ b/libnymea-core/cloud/cloudnotifications.cpp @@ -33,12 +33,6 @@ ParamTypeId notifyActionParamBodyId = ParamTypeId("4bd0fa87-c663-4621-8040-99b6d StateTypeId connectedStateTypeId = StateTypeId("518e27b6-c3bf-49d7-be24-05ae978c00f7"); -// FIXME: This ZAPF_HOTFIX is here to disable some features in order to meet the ZAPF deadline -// Once the cloud infrastructure is fixed to properly give out unique and persistent ids -// for push notification enabled devices, remove this complete commit (apply -r) -// It should remove all the ZAPF_HOTFIX parts in here and one line in awsconnector.cpp -#define ZAPF_HOTFIX 1 - CloudNotifications::CloudNotifications(AWSConnector* awsConnector, QObject *parent): DevicePlugin(parent), m_awsConnector(awsConnector) @@ -169,27 +163,6 @@ DeviceManager::DeviceError CloudNotifications::executeAction(Device *device, con void CloudNotifications::pushNotificationEndpointsUpdated(const QList &endpoints) { qCDebug(dcCloud()) << "Push Notification endpoint update"; -#if ZAPF_HOTFIX - if (endpoints.isEmpty() && myDevices().count() > 0) { - emit autoDeviceDisappeared(myDevices().first()->id()); - return; - } - - if (myDevices().count() > 0) { - // already have a device, ignore it - return; - } - - DeviceDescriptor descriptor(cloudNotificationsDeviceClassId, "Push notifications", ""); - ParamList params; - Param userIdParam(cloudNotificationsDeviceClassUserParamId, ""); // Not used for now - params.append(userIdParam); - Param endpointIdParam(cloudNotificationsDeviceClassEndpointParamId, "everyone"); - params.append(endpointIdParam); - descriptor.setParams(params); - emit autoDevicesAppeared(cloudNotificationsDeviceClassId, {descriptor}); - -#else QList devicesToRemove; foreach (Device *configuredDevice, myDevices()) { bool found = false; @@ -231,14 +204,11 @@ void CloudNotifications::pushNotificationEndpointsUpdated(const QList