summaryrefslogtreecommitdiff
path: root/buteo-plugins
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@jolla.com>2026-02-10 23:52:48 +0100
committerAndrew Branson <andrew.branson@jolla.com>2026-02-11 00:12:00 +0100
commitb42a78104f6d38ab3aa578e8d2201ac8c685a28c (patch)
tree0a3cbf5483f0272f1a20678907a240ab8bfb0b11 /buteo-plugins
parent69628390815254297bbd8c95436f6780fa846fae (diff)
Show account handle as description
Diffstat (limited to 'buteo-plugins')
-rw-r--r--buteo-plugins/buteo-sync-plugin-mastodon-notifications/mastodonnotificationssyncadaptor.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/buteo-plugins/buteo-sync-plugin-mastodon-notifications/mastodonnotificationssyncadaptor.cpp b/buteo-plugins/buteo-sync-plugin-mastodon-notifications/mastodonnotificationssyncadaptor.cpp
index 79b996c..e3eff52 100644
--- a/buteo-plugins/buteo-sync-plugin-mastodon-notifications/mastodonnotificationssyncadaptor.cpp
+++ b/buteo-plugins/buteo-sync-plugin-mastodon-notifications/mastodonnotificationssyncadaptor.cpp
@@ -555,9 +555,19 @@ void MastodonNotificationsSyncAdaptor::publishSystemNotification(int accountId,
const QString openUrl = notificationData.link.isEmpty()
? apiHost(accountId) + QStringLiteral("/notifications")
: notificationData.link;
+ const QUrl parsedOpenUrl(openUrl);
+ const QString fallbackUrl = apiHost(accountId) + QStringLiteral("/notifications");
+ const QString safeOpenUrl = parsedOpenUrl.isValid()
+ && !parsedOpenUrl.scheme().isEmpty()
+ && !parsedOpenUrl.host().isEmpty()
+ ? openUrl
+ : fallbackUrl;
+ QStringList openUrlArgs;
+ openUrlArgs << safeOpenUrl;
+
notification->setProperty(LastReadIdProperty, notificationData.notificationId);
notification->setUrgency(Notification::Low);
- notification->setRemoteAction(OPEN_BROWSER_ACTION(QStringList() << openUrl));
+ notification->setRemoteAction(OPEN_BROWSER_ACTION(openUrlArgs));
notification->publish();
if (notification->replacesId() == 0) {
qCWarning(lcSocialPlugin) << "failed to publish Mastodon notification"