From c65be84a89be5640480c7edd97e86648b10f3061 Mon Sep 17 00:00:00 2001 From: Albert Vaca Date: Wed, 9 Sep 2015 01:14:30 -0700 Subject: [PATCH] Only send capabilities packets for paired devices --- core/device.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/device.cpp b/core/device.cpp index 0d6611bfc..b5f48956e 100644 --- a/core/device.cpp +++ b/core/device.cpp @@ -125,8 +125,10 @@ void Device::reloadPlugins() const QSet outgoingInterfaces = KPluginMetaData::readStringList(service.rawData(), "X-KdeConnect-OutgoingPackageType").toSet(); const bool pluginEnabled = isPluginEnabled(pluginName); - if (pluginEnabled) + + if (pluginEnabled) { supportedIncomingInterfaces += incomingInterfaces; + } //If we don't find intersection with the received on one end and the sent on the other, we don't //let the plugin stay @@ -176,7 +178,7 @@ void Device::reloadPlugins() } Q_EMIT pluginsChanged(); - if (capabilitiesChanged) + if (capabilitiesChanged && isReachable() && isPaired()) { NetworkPackage np(PACKAGE_TYPE_CAPABILITIES); np.set("SupportedIncomingInterfaces", newSupportedIncomingInterfaces);