Add matrix: URL to push notifications

This commit is contained in:
Joshua Goins
2023-11-12 18:25:55 -05:00
parent 7ad7af56e8
commit 5be2113b32

View File

@@ -326,7 +326,12 @@ void NotificationsManager::postPushNotification(const QByteArray &message)
#ifdef HAVE_KIO
auto openAction = notification->addAction(i18n("Open NeoChat"));
connect(openAction, &KNotificationAction::activated, this, [=]() {
QString properId = roomId;
properId = properId.replace(QStringLiteral("#"), QString());
properId = properId.replace(QStringLiteral("!"), QString());
auto *job = new KIO::ApplicationLauncherJob(KService::serviceByDesktopName(QStringLiteral("org.kde.neochat")));
job->setUrls({QUrl::fromUserInput(QStringLiteral("matrix:r/%1").arg(properId))});
job->start();
});
#endif