diff options
Diffstat (limited to 'src/activitypub/apactivity.h')
-rw-r--r-- | src/activitypub/apactivity.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/activitypub/apactivity.h b/src/activitypub/apactivity.h index fcfb86c..dd6c09e 100644 --- a/src/activitypub/apactivity.h +++ b/src/activitypub/apactivity.h @@ -5,6 +5,8 @@ #include "apobject.h" #include "../types.h" #include <QDateTime> +#include <QMetaType> +#include <memory> enum struct APActivityType {CREATE, ANNOUNCE, UNKNOWN}; @@ -14,7 +16,7 @@ struct APActivityFields { QStringList cc_actors; QString object_url; // maps to "id", represents the Activity, *not* the URL of the object it contains QString published; - APObject* object; // will generally be a APPost or APReblog + APObjectPtr object; // will generally be a APPost or APReblog StatusType visibility; APActivityType type = APActivityType::UNKNOWN; }; @@ -25,9 +27,9 @@ public: // An Activity that can easily be constructed from an ActivityStreams JSON Activity. Make sure to pass the APObject. APActivity(APActivityFields fields); - ~APActivity(); + ~APActivity() {}; - APObject* object = nullptr; // the object that's manipulated by this Activity, use APPost for something useful and "manually" create it + APObjectPtr object; // the object that's manipulated by this Activity, use APPost for something useful and "manually" create it QString get_html_render(HtmlRenderDetails render_info); @@ -43,3 +45,6 @@ private: QDateTime published; }; + +typedef std::shared_ptr<APActivity> APActivityPtr; +Q_DECLARE_METATYPE(APActivityPtr); |