diff options
Diffstat (limited to 'buteo-plugins/buteo-sync-plugin-mastodon-notifications/mastodonnotificationssyncadaptor.h')
| -rw-r--r-- | buteo-plugins/buteo-sync-plugin-mastodon-notifications/mastodonnotificationssyncadaptor.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/buteo-plugins/buteo-sync-plugin-mastodon-notifications/mastodonnotificationssyncadaptor.h b/buteo-plugins/buteo-sync-plugin-mastodon-notifications/mastodonnotificationssyncadaptor.h index 9711549..0e9106c 100644 --- a/buteo-plugins/buteo-sync-plugin-mastodon-notifications/mastodonnotificationssyncadaptor.h +++ b/buteo-plugins/buteo-sync-plugin-mastodon-notifications/mastodonnotificationssyncadaptor.h @@ -41,6 +41,7 @@ public: QString syncServiceName() const override; protected: + QString authServiceName() const override; void purgeDataForOldAccount(int oldId, SocialNetworkSyncAdaptor::PurgeMode mode) override; void beginSync(int accountId, const QString &accessToken) override; void finalize(int accountId) override; @@ -56,9 +57,11 @@ private: struct PendingSyncState { QString accessToken; + bool markerKnown = false; QString unreadFloorId; QString lastFetchedId; QString maxFetchedId; + QSet<QString> unreadNotificationIds; QHash<QString, PendingNotification> pendingNotifications; }; @@ -79,13 +82,20 @@ private: Notification *findNotification(int accountId, const QString ¬ificationId); void closeAccountNotifications(int accountId, const QSet<QString> &keepNotificationIds = QSet<QString>()); static QString notificationObjectKey(int accountId, const QString ¬ificationId); + void maybeMarkAccountNotificationsRead(int accountId, + const QString &accessToken, + Notification *ignoredNotification = 0); + void markReadFromNotification(Notification *notification); + void removeCachedNotification(Notification *notification); private Q_SLOTS: void finishedUnreadMarkerHandler(); void finishedNotificationsHandler(); void finishedMarkReadHandler(); + void notificationClosedWithReason(uint reason); private: + QHash<int, QString> m_accessTokens; QHash<int, PendingSyncState> m_pendingSyncStates; QHash<int, QString> m_lastMarkedReadIds; QHash<QString, Notification *> m_notificationObjects; |
