summaryrefslogtreecommitdiff
path: root/buteo-plugins/buteo-sync-plugin-mastodon-notifications/mastodonnotificationssyncadaptor.h
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@jolla.com>2026-02-11 10:05:38 +0100
committerAndrew Branson <andrew.branson@jolla.com>2026-02-11 10:05:38 +0100
commitd8ff92c1baf2c9714f21729e7d37c66f59c162ff (patch)
treecaddf8f9f497ed7090d83ce61c43ceb777b29162 /buteo-plugins/buteo-sync-plugin-mastodon-notifications/mastodonnotificationssyncadaptor.h
parent02b3826491b05e29fff3ec9e585e9919047b2ab9 (diff)
Fix notification fetching - don't change server unread, just record our last seen
Diffstat (limited to 'buteo-plugins/buteo-sync-plugin-mastodon-notifications/mastodonnotificationssyncadaptor.h')
-rw-r--r--buteo-plugins/buteo-sync-plugin-mastodon-notifications/mastodonnotificationssyncadaptor.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/buteo-plugins/buteo-sync-plugin-mastodon-notifications/mastodonnotificationssyncadaptor.h b/buteo-plugins/buteo-sync-plugin-mastodon-notifications/mastodonnotificationssyncadaptor.h
index 0cd63a4..9711549 100644
--- a/buteo-plugins/buteo-sync-plugin-mastodon-notifications/mastodonnotificationssyncadaptor.h
+++ b/buteo-plugins/buteo-sync-plugin-mastodon-notifications/mastodonnotificationssyncadaptor.h
@@ -56,13 +56,17 @@ private:
struct PendingSyncState {
QString accessToken;
- QString minReadId;
+ QString unreadFloorId;
+ QString lastFetchedId;
+ QString maxFetchedId;
QHash<QString, PendingNotification> pendingNotifications;
};
static QString sanitizeContent(const QString &content);
static QDateTime parseTimestamp(const QString &timestampString);
static int compareNotificationIds(const QString &left, const QString &right);
+ QString loadLastFetchedId(int accountId) const;
+ void saveLastFetchedId(int accountId, const QString &lastFetchedId);
void requestUnreadMarker(int accountId, const QString &accessToken);
void requestNotifications(int accountId,
@@ -75,17 +79,14 @@ private:
Notification *findNotification(int accountId, const QString &notificationId);
void closeAccountNotifications(int accountId, const QSet<QString> &keepNotificationIds = QSet<QString>());
static QString notificationObjectKey(int accountId, const QString &notificationId);
- void markReadFromNotification(Notification *notification);
private Q_SLOTS:
void finishedUnreadMarkerHandler();
void finishedNotificationsHandler();
void finishedMarkReadHandler();
- void notificationClosedWithReason(uint reason);
private:
QHash<int, PendingSyncState> m_pendingSyncStates;
- QHash<int, QString> m_accessTokens;
QHash<int, QString> m_lastMarkedReadIds;
QHash<QString, Notification *> m_notificationObjects;
};