aboutsummaryrefslogtreecommitdiffstats
path: root/src/activitypub/apobject.h
blob: 5f17e80f9f1259c1eadec33115addf85d764a67f (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
#pragma once

#include "apbase.h"
#include "apactor.h"
#include "apattachment.h"
#include "../types.h"
#include <QDateTime>
#include <QMetaType>
#include <memory>

class APObject : protected APBase {
public:
    // An empty object
    APObject();

    // An object that will be fetched through the remote instance
    APObject(const QString& url);
    ~APObject() {};

    // The object will be built from the fetched URL
    void load_object_url(const QString& url);

    const QString get_object_url();

    virtual QString get_html_render(HtmlRenderDetails render_info);

protected:
    APActorList to_actors;
    APActorList cc_actors;
    APActor by_actor; // maps to "attributedTo"
    StatusType visibility; // status_type

    QString web_url; // URL that has something like a user accessible web user front-end
    QString reply_to_url; // in reply to, this is not really a URL but a APPost that could be retrived. maybe have a method for creating that object?
    QDateTime published; // publishing date

    APAttachmentList attachments;
};

typedef std::shared_ptr<APObject> APObjectPtr;
Q_DECLARE_METATYPE(APObjectPtr);