From 05963bae298b7548957647c643d1dd0d9fc8728c Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Sat, 19 Oct 2024 23:47:39 +0200 Subject: [PATCH] Drop code for forwarding messages to Telepathy Telepathy has been dead for quite some time now --- plugins/sms/smsplugin.cpp | 18 ------------------ plugins/sms/smsplugin.h | 6 ------ 2 files changed, 24 deletions(-) diff --git a/plugins/sms/smsplugin.cpp b/plugins/sms/smsplugin.cpp index 82e7cb5bd..765eca15c 100644 --- a/plugins/sms/smsplugin.cpp +++ b/plugins/sms/smsplugin.cpp @@ -27,7 +27,6 @@ K_PLUGIN_CLASS_WITH_JSON(SmsPlugin, "kdeconnect_sms.json") SmsPlugin::SmsPlugin(QObject *parent, const QVariantList &args) : KdeConnectPlugin(parent, args) - , m_telepathyInterface(QStringLiteral("org.freedesktop.Telepathy.ConnectionManager.kdeconnect"), QStringLiteral("/kdeconnect")) , m_conversationInterface(new ConversationsDbusInterface(this)) { } @@ -112,20 +111,6 @@ void SmsPlugin::requestAttachment(const qint64 &partID, const QString &uniqueIde sendPacket(np); } -void SmsPlugin::forwardToTelepathy(const ConversationMessage &message) -{ - // If we don't have a valid Telepathy interface, bail out - if (!(m_telepathyInterface.isValid())) - return; - - qCDebug(KDECONNECT_PLUGIN_SMS) << "Passing a text message to the telepathy interface"; - connect(&m_telepathyInterface, SIGNAL(messageReceived(QString, QString)), this, SLOT(sendSms(QString, QString)), Qt::UniqueConnection); - const QString messageBody = message.body(); - const QString contactName; // TODO: When telepathy support is improved, look up the contact with KPeople - const QString phoneNumber = message.addresses()[0].address(); - m_telepathyInterface.call(QDBus::NoBlock, QStringLiteral("sendMessage"), phoneNumber, contactName, messageBody); -} - bool SmsPlugin::handleBatchMessages(const NetworkPacket &np) { const auto messages = np.get(QStringLiteral("messages")); @@ -134,9 +119,6 @@ bool SmsPlugin::handleBatchMessages(const NetworkPacket &np) for (const QVariant &body : messages) { ConversationMessage message(body.toMap()); - if (message.containsTextBody()) { - forwardToTelepathy(message); - } messagesList.append(message); } diff --git a/plugins/sms/smsplugin.h b/plugins/sms/smsplugin.h index e397eaeb2..874c4d721 100644 --- a/plugins/sms/smsplugin.h +++ b/plugins/sms/smsplugin.h @@ -177,11 +177,6 @@ public Q_SLOTS: Q_SCRIPTABLE void getAttachment(const qint64 &partID, const QString &uniqueIdentifier); private: - /** - * Send to the telepathy plugin if it is available - */ - void forwardToTelepathy(const ConversationMessage &message); - /** * Handle a packet which contains many messages, such as PACKET_TYPE_TELEPHONY_MESSAGE */ @@ -197,6 +192,5 @@ private: */ Attachment createAttachmentFromUrl(const QString &url); - QDBusInterface m_telepathyInterface; ConversationsDbusInterface *m_conversationInterface; };