From e515ca109faa897e84be8a97a1240c59df612dd4 Mon Sep 17 00:00:00 2001 From: ConfuSomu Date: Wed, 5 Jul 2023 15:14:46 +0200 Subject: Implement a small library of ActivityPub objects These objects allow, and will allow us, to move HTML rendering out of the archive parser and into separate classes. Each of the derived classes specialise HTML rendering for their specific requirements. Furthermore, these ActivityPub objects will be able to be expanded upon and have support to be written to disk, in a database, for instance. Separating ActivityPub object retrieving from rendering allows us to implement other retrieving sources and methods, such as downloading posts from a configured remote instance. --- src/activitypub/apactor.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/activitypub/apactor.h (limited to 'src/activitypub/apactor.h') diff --git a/src/activitypub/apactor.h b/src/activitypub/apactor.h new file mode 100644 index 0000000..60ef0bf --- /dev/null +++ b/src/activitypub/apactor.h @@ -0,0 +1,25 @@ +#pragma once + +#include "apbase.h" +#include + +// APActors will have an avatar, display name, username and more that will be fetched using the remote instance +class APActor : APBase { +public: + // Empty actor + APActor(); + APActor(const QString url); + ~APActor() {}; + + const QString get_url(); + + QString get_html_render(HtmlRenderDetails render_info); + const QString get_plain_render(); +private: + QString object_url; +}; + +class APActorList : public std::vector, APBase { +public: + QString get_html_render(HtmlRenderDetails render_info); +}; -- cgit v1.2.3-54-g00ecf