diff options
| author | Andrew Branson <andrew.branson@jolla.com> | 2026-02-10 23:52:48 +0100 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@jolla.com> | 2026-02-11 00:12:00 +0100 |
| commit | b42a78104f6d38ab3aa578e8d2201ac8c685a28c (patch) | |
| tree | 0a3cbf5483f0272f1a20678907a240ab8bfb0b11 /buteo-plugins/buteo-sync-plugin-mastodon-notifications/mastodonnotificationssyncadaptor.cpp | |
| parent | 69628390815254297bbd8c95436f6780fa846fae (diff) | |
Show account handle as description
Diffstat (limited to 'buteo-plugins/buteo-sync-plugin-mastodon-notifications/mastodonnotificationssyncadaptor.cpp')
| -rw-r--r-- | buteo-plugins/buteo-sync-plugin-mastodon-notifications/mastodonnotificationssyncadaptor.cpp | 12 |
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" |
