diff options
author | ConfuSomu | 2023-07-05 15:14:46 +0200 |
---|---|---|
committer | ConfuSomu | 2023-07-05 15:14:46 +0200 |
commit | e515ca109faa897e84be8a97a1240c59df612dd4 (patch) | |
tree | 2a5e0593bb4387449a9a60fb2aefcc74779b5c67 /src/activitypub/apreblog.cpp | |
parent | 0dfab2456b2dcd33f1879ac7d5606dd65cdb8e40 (diff) | |
download | ActorViewer-e515ca109faa897e84be8a97a1240c59df612dd4.tar ActorViewer-e515ca109faa897e84be8a97a1240c59df612dd4.tar.gz ActorViewer-e515ca109faa897e84be8a97a1240c59df612dd4.zip |
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.
Diffstat (limited to 'src/activitypub/apreblog.cpp')
-rw-r--r-- | src/activitypub/apreblog.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/activitypub/apreblog.cpp b/src/activitypub/apreblog.cpp new file mode 100644 index 0000000..a6c6c3b --- /dev/null +++ b/src/activitypub/apreblog.cpp @@ -0,0 +1,13 @@ +#include "apreblog.h" + +APReblog::APReblog(APReblogFields fields) { + object.load_object_url(fields.object); // might have to be fixed + visibility = fields.visibility; +} + +QString APReblog::get_html_render(HtmlRenderDetails info) { + QString text = "Reblog of this object: <a href=\"{{url}}\">{{url}}</a><hr/>"; + text.replace("{{url}}", object.get_object_url()); + text.append(object.get_html_render(info)); + return text; +} |