blob: dd6c09ed15e47bc53718bb404b94e13fbfe8e301 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
#pragma once
#include "apactor.h"
#include "apbase.h"
#include "apobject.h"
#include "../types.h"
#include <QDateTime>
#include <QMetaType>
#include <memory>
enum struct APActivityType {CREATE, ANNOUNCE, UNKNOWN};
struct APActivityFields {
QString by_actor;
QStringList to_actors;
QStringList cc_actors;
QString object_url; // maps to "id", represents the Activity, *not* the URL of the object it contains
QString published;
APObjectPtr object; // will generally be a APPost or APReblog
StatusType visibility;
APActivityType type = APActivityType::UNKNOWN;
};
class APActivity : APBase {
public:
APActivity();
// An Activity that can easily be constructed from an ActivityStreams JSON Activity. Make sure to pass the APObject.
APActivity(APActivityFields fields);
~APActivity() {};
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);
private:
APActorList to_actors;
APActorList cc_actors;
APActor by_actor; // the Actor who did this Activity, maps to "actor"
APActivityType type;
StatusType visibility;
//QString object_url; // activity's URL, maps to "id"
QDateTime published;
};
typedef std::shared_ptr<APActivity> APActivityPtr;
Q_DECLARE_METATYPE(APActivityPtr);
|