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/apreblog.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/activitypub/apreblog.h (limited to 'src/activitypub/apreblog.h') diff --git a/src/activitypub/apreblog.h b/src/activitypub/apreblog.h new file mode 100644 index 0000000..cc340b8 --- /dev/null +++ b/src/activitypub/apreblog.h @@ -0,0 +1,27 @@ +#pragma once + +#include "apobject.h" +#include "apobject.h" +#include "src/types.h" +#include + +struct APReblogFields { + QString object; // the object's URL that was reblogged + StatusType visibility; // you can have non-public visibility of reblogs on Mastodon +}; + +// APReblog represents an ActivityPub Announce activity, which is a kind of object in a sense. This class is really used just for light bookeeping. +// The visibility is just the visibility (to & cc) of the APActivity it came from. +class APReblog : public APObject { +public: + APReblog(); + // A post that will be built from strings + APReblog(APReblogFields fields); + ~APReblog() {}; + + QString get_html_render(HtmlRenderDetails render_info); + +protected: + APObject object; // the object that was reblogged (impossible to be an APReblog) + StatusType visibility; +}; -- cgit v1.2.3-54-g00ecf