telepathy-qt: BaseConnection::createChannel(): Fixed checks for .Requested property.

Alexandr Akulich kaffeine at kemper.freedesktop.org
Sat Aug 29 05:49:54 PDT 2015


Module: telepathy-qt
Branch: master
Commit: 5af7f97ae33f22595ce868c37041adf5f5d1a579
URL:    http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=5af7f97ae33f22595ce868c37041adf5f5d1a579

Author: Alexandr Akulich <akulichalexander at gmail.com>
Date:   Fri Aug 14 12:04:05 2015 +0600

BaseConnection::createChannel(): Fixed checks for .Requested property.

1) Removed the property values getter, because the property must be never
exists in the request.
2) Requests with the property now ignored, as the spec declare it.

---

 TelepathyQt/base-connection.cpp |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/TelepathyQt/base-connection.cpp b/TelepathyQt/base-connection.cpp
index a943d38..1694e69 100644
--- a/TelepathyQt/base-connection.cpp
+++ b/TelepathyQt/base-connection.cpp
@@ -379,6 +379,11 @@ Tp::BaseChannelPtr BaseConnection::createChannel(const QVariantMap &request, boo
         return BaseChannelPtr();
     }
 
+    if (request.contains(TP_QT_IFACE_CHANNEL + QLatin1String(".Requested"))) {
+        error->set(TP_QT_ERROR_INVALID_ARGUMENT, QString(QLatin1String("The %1.Requested property must not be presented in the request details.")).arg(TP_QT_IFACE_CHANNEL));
+        return BaseChannelPtr();
+    }
+
     QVariantMap requestDetails = request;
     requestDetails[TP_QT_IFACE_CHANNEL + QLatin1String(".Requested")] = suppressHandler;
 
@@ -415,7 +420,7 @@ Tp::BaseChannelPtr BaseConnection::createChannel(const QVariantMap &request, boo
     }
     channel->setInitiatorID(initiatorID);
     channel->setTargetID(targetID);
-    channel->setRequested(request.value(TP_QT_IFACE_CHANNEL + QLatin1String(".Requested"), suppressHandler).toBool());
+    channel->setRequested(suppressHandler);
 
     channel->registerObject(error);
     if (error->isValid())



More information about the telepathy-commits mailing list