Commit f778fc93 authored by Aniket Kumar's avatar Aniket Kumar 🤵 Committed by Nicolas Fella

Updated kdeconnect-cli send-sms message to adapt sendSms interfce changes....

Updated kdeconnect-cli send-sms message to adapt sendSms interfce changes. This patch fixes the BUG: 425731
parent f90d6a01
Pipeline #32125 canceled with stage
......@@ -17,6 +17,7 @@
#include "interfaces/notificationsmodel.h"
#include "interfaces/dbusinterfaces.h"
#include "interfaces/dbushelpers.h"
#include "interfaces/conversationmessage.h"
#include "kdeconnect-version.h"
#include <dbushelper.h>
......@@ -247,8 +248,19 @@ int main(int argc, char** argv)
blockOnReply(DBusHelper::sessionBus().asyncCall(msg));
} else if(parser.isSet(QStringLiteral("send-sms"))) {
if (parser.isSet(QStringLiteral("destination"))) {
qDBusRegisterMetaType<ConversationAddress>();
QVariantList addresses;
const QStringList addressList = parser.value(QStringLiteral("destination")).split(QRegularExpression(QStringLiteral("\\s+")));
for (const QString& input : addressList) {
ConversationAddress address(input);
addresses << QVariant::fromValue(address);
}
QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.kde.kdeconnect"), QStringLiteral("/modules/kdeconnect/devices/") + device + QStringLiteral("/sms"), QStringLiteral("org.kde.kdeconnect.device.sms"), QStringLiteral("sendSms"));
msg.setArguments({ parser.value(QStringLiteral("destination")), parser.value(QStringLiteral("send-sms"))});
const QString text = parser.value(QStringLiteral("send-sms"));
msg.setArguments(QVariantList() << QVariant::fromValue(addresses) << text);
blockOnReply(DBusHelper::sessionBus().asyncCall(msg));
} else {
QTextStream(stderr) << i18n("error: should specify the SMS's recipient by passing --destination <phone number>");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment