From 40fd76d5b992fb868b44a6f76152655a0408e37b Mon Sep 17 00:00:00 2001 From: ConfuSomu Date: Tue, 12 Sep 2023 09:38:16 -0400 Subject: Implement archive method for getting APActivity This replaces the existing method that returns HTML with a method that gives us an APActivity object, which is more precise and allows more extension in the future. --- src/archive/base_archive.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/archive/base_archive.h') diff --git a/src/archive/base_archive.h b/src/archive/base_archive.h index 4fdf08c..a6bf98f 100644 --- a/src/archive/base_archive.h +++ b/src/archive/base_archive.h @@ -3,6 +3,7 @@ #include #include #include +#include "src/activitypub/apactivity.h" #include "src/types.h" enum ArchiveType { @@ -21,13 +22,18 @@ public: JsonNotActivityStream // for ActivityPub archives }; + struct Hinting_t { + StatusType status_type = UNKNOWN; + }; + virtual ~Archive() {}; virtual std::variant init() = 0; static Archive* create_archive(ArchiveType archive_type, const QString& main_filename); virtual void update_status_list(ViewStatusTypes allowed_types, QListWidget *parent) = 0; - virtual const QString get_html_status_info(int status_index, int text_zone_width, StatusType status_type, QLocale* locale) = 0; + // TODO: use a index type instead of a bare int as the former can be extended + virtual APActivity* get_activity(int index, Hinting_t hinting) = 0; virtual const QString get_html_status_text(int status_index) = 0; virtual const QString get_instance_address(); -- cgit v1.2.3-54-g00ecf