summaryrefslogtreecommitdiff
path: root/buteo-plugins
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@jolla.com>2026-02-11 17:10:58 +0100
committerAndrew Branson <andrew.branson@jolla.com>2026-02-11 17:10:58 +0100
commit22c763f1ffdc7dc845be03c05851d7b896081cb2 (patch)
treeeab1542f91f758c88d8b3cd43ed2f66276f78119 /buteo-plugins
parentd8ff92c1baf2c9714f21729e7d37c66f59c162ff (diff)
Add post metadata to events view and enhance notification handling
Diffstat (limited to 'buteo-plugins')
-rw-r--r--buteo-plugins/buteo-sync-plugin-mastodon-notifications/mastodonnotificationssyncadaptor.cpp15
-rw-r--r--buteo-plugins/buteo-sync-plugin-mastodon-posts/mastodonpostssyncadaptor.cpp6
2 files changed, 12 insertions, 9 deletions
diff --git a/buteo-plugins/buteo-sync-plugin-mastodon-notifications/mastodonnotificationssyncadaptor.cpp b/buteo-plugins/buteo-sync-plugin-mastodon-notifications/mastodonnotificationssyncadaptor.cpp
index f4e70ae..d5d1766 100644
--- a/buteo-plugins/buteo-sync-plugin-mastodon-notifications/mastodonnotificationssyncadaptor.cpp
+++ b/buteo-plugins/buteo-sync-plugin-mastodon-notifications/mastodonnotificationssyncadaptor.cpp
@@ -38,15 +38,15 @@
#include <algorithm>
-#define OPEN_BROWSER_ACTION(openUrlArgs) \
+#define OPEN_URL_ACTION(openUrl) \
Notification::remoteAction( \
"default", \
"", \
- "org.sailfishos.browser", \
+ "org.sailfishos.fileservice", \
"/", \
- "org.sailfishos.browser", \
+ "org.sailfishos.fileservice", \
"openUrl", \
- QVariantList() << openUrlArgs \
+ QVariantList() << openUrl \
)
namespace {
@@ -655,11 +655,7 @@ void MastodonNotificationsSyncAdaptor::publishSystemNotification(int accountId,
&& !parsedOpenUrl.host().isEmpty()
? openUrl
: fallbackUrl;
- QStringList openUrlArgs;
- openUrlArgs << safeOpenUrl;
-
- notification->setUrgency(Notification::Low);
- notification->setRemoteAction(OPEN_BROWSER_ACTION(openUrlArgs));
+ notification->setRemoteAction(OPEN_URL_ACTION(safeOpenUrl));
notification->publish();
if (notification->replacesId() == 0) {
qCWarning(lcSocialPlugin) << "failed to publish Mastodon notification"
@@ -728,6 +724,7 @@ Notification *MastodonNotificationsSyncAdaptor::createNotification(int accountId
notification->setHintValue("x-nemo.sociald.account-id", accountId);
notification->setHintValue(NotificationIdHint, notificationId);
notification->setHintValue("x-nemo-feedback", QStringLiteral("social"));
+ notification->setHintValue("x-nemo-priority", 100); // Show on lockscreen
notification->setCategory(QLatin1String(NotificationCategory));
m_notificationObjects.insert(objectKey, notification);
diff --git a/buteo-plugins/buteo-sync-plugin-mastodon-posts/mastodonpostssyncadaptor.cpp b/buteo-plugins/buteo-sync-plugin-mastodon-posts/mastodonpostssyncadaptor.cpp
index c7c696e..6165931 100644
--- a/buteo-plugins/buteo-sync-plugin-mastodon-posts/mastodonpostssyncadaptor.cpp
+++ b/buteo-plugins/buteo-sync-plugin-mastodon-posts/mastodonpostssyncadaptor.cpp
@@ -270,6 +270,9 @@ void MastodonPostsSyncAdaptor::finishedPostsHandler()
}
const QString body = sanitizeContent(postObject.value(QStringLiteral("content")).toString());
+ const int repliesCount = postObject.value(QStringLiteral("replies_count")).toInt();
+ const int favouritesCount = postObject.value(QStringLiteral("favourites_count")).toInt();
+ const int reblogsCount = postObject.value(QStringLiteral("reblogs_count")).toInt();
QList<QPair<QString, SocialPostImage::ImageType> > imageList;
const QJsonArray mediaAttachments = postObject.value(QStringLiteral("media_attachments")).toArray();
@@ -304,6 +307,9 @@ void MastodonPostsSyncAdaptor::finishedPostsHandler()
imageList,
url,
boostedBy,
+ repliesCount,
+ favouritesCount,
+ reblogsCount,
apiHost(accountId),
accountId);
}