summaryrefslogtreecommitdiff
path: root/eventsview-plugins/eventsview-plugin-mastodon/mastodonpostsmodel.cpp
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@jolla.com>2026-02-12 12:34:14 +0100
committerAndrew Branson <andrew.branson@jolla.com>2026-02-12 15:05:57 +0100
commitbce74e963abeb96a9c335f5461611dee544abc4c (patch)
treeca584a97f1094212c79942702c6b96f6c66029c0 /eventsview-plugins/eventsview-plugin-mastodon/mastodonpostsmodel.cpp
parent6ec21cf79e0103b874086089673800bd32fc6bea (diff)
Enhance Mastodon post actions and metadata handling for reblogs and favourites
Diffstat (limited to 'eventsview-plugins/eventsview-plugin-mastodon/mastodonpostsmodel.cpp')
-rw-r--r--eventsview-plugins/eventsview-plugin-mastodon/mastodonpostsmodel.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/eventsview-plugins/eventsview-plugin-mastodon/mastodonpostsmodel.cpp b/eventsview-plugins/eventsview-plugin-mastodon/mastodonpostsmodel.cpp
index 4fe37d9..855d9be 100644
--- a/eventsview-plugins/eventsview-plugin-mastodon/mastodonpostsmodel.cpp
+++ b/eventsview-plugins/eventsview-plugin-mastodon/mastodonpostsmodel.cpp
@@ -66,6 +66,8 @@ QHash<int, QByteArray> MastodonPostsModel::roleNames() const
roleNames.insert(RepliesCount, "repliesCount");
roleNames.insert(FavouritesCount, "favouritesCount");
roleNames.insert(ReblogsCount, "reblogsCount");
+ roleNames.insert(Favourited, "favourited");
+ roleNames.insert(Reblogged, "reblogged");
roleNames.insert(InstanceUrl, "instanceUrl");
roleNames.insert(Accounts, "accounts");
return roleNames;
@@ -106,6 +108,8 @@ void MastodonPostsModel::postsChanged()
const int repliesCount = d->database.repliesCount(post);
const int favouritesCount = d->database.favouritesCount(post);
const int reblogsCount = d->database.reblogsCount(post);
+ const bool favourited = d->database.favourited(post);
+ const bool reblogged = d->database.reblogged(post);
eventMap.insert(MastodonPostsModel::MastodonId, post->identifier());
eventMap.insert(MastodonPostsModel::Name, post->name());
@@ -121,6 +125,8 @@ void MastodonPostsModel::postsChanged()
eventMap.insert(MastodonPostsModel::RepliesCount, repliesCount);
eventMap.insert(MastodonPostsModel::FavouritesCount, favouritesCount);
eventMap.insert(MastodonPostsModel::ReblogsCount, reblogsCount);
+ eventMap.insert(MastodonPostsModel::Favourited, favourited);
+ eventMap.insert(MastodonPostsModel::Reblogged, reblogged);
eventMap.insert(MastodonPostsModel::InstanceUrl, d->database.instanceUrl(post));
QVariantList images;