diff options
| author | Andrew Branson <andrew.branson@jolla.com> | 2026-04-03 22:55:30 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@jolla.com> | 2026-04-04 11:55:25 +0200 |
| commit | a35c9fa159173388d88ef77e1d31f53488aad094 (patch) | |
| tree | e4691b5bbf054ca13e35d98d9df653bf9cdc0054 /common/fediversepostsdatabase.h | |
| parent | 5f999f7a4712c4a4d1c89054b544064cfd4b769e (diff) | |
Generalize for all fediverse accounts
Diffstat (limited to 'common/fediversepostsdatabase.h')
| -rw-r--r-- | common/fediversepostsdatabase.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/common/fediversepostsdatabase.h b/common/fediversepostsdatabase.h new file mode 100644 index 0000000..2c085e0 --- /dev/null +++ b/common/fediversepostsdatabase.h @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2013-2026 Jolla Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef FEDIVERSEPOSTSDATABASE_H +#define FEDIVERSEPOSTSDATABASE_H + +#include <abstractsocialpostcachedatabase.h> + +class FediversePostsDatabase: public AbstractSocialPostCacheDatabase +{ + Q_OBJECT +public: + FediversePostsDatabase(); + ~FediversePostsDatabase(); + + void addFediversePost(const QString &identifier, const QString &name, + const QString &accountName, const QString &body, + const QDateTime ×tamp, + const QString &icon, + const QList<QPair<QString, SocialPostImage::ImageType> > &images, + const QString &url, const QString &boostedBy, + int repliesCount, int favouritesCount, int reblogsCount, + bool favourited, bool reblogged, + const QString &instanceUrl, + const QString &instanceIconPath, + int account); + + static QString accountName(const SocialPost::ConstPtr &post); + static QString url(const SocialPost::ConstPtr &post); + static QString boostedBy(const SocialPost::ConstPtr &post); + static int repliesCount(const SocialPost::ConstPtr &post); + static int favouritesCount(const SocialPost::ConstPtr &post); + static int reblogsCount(const SocialPost::ConstPtr &post); + static bool favourited(const SocialPost::ConstPtr &post); + static bool reblogged(const SocialPost::ConstPtr &post); + static QString instanceUrl(const SocialPost::ConstPtr &post); + static QString instanceIconPath(const SocialPost::ConstPtr &post); +}; + +#endif // FEDIVERSEPOSTSDATABASE_H |
