aboutsummaryrefslogtreecommitdiff
path: root/lib/events/receiptevent.h
blob: ec297a6cfe304e54a474448dac619199b563750f (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
/******************************************************************************
 * SPDX-FileCopyrightText: 2016 Felix Rohrbach <kde@fxrh.de>
 *
 * SPDX-License-Identifier: LGPL-2.1-or-later
 */

#pragma once

#include "event.h"

#include <QtCore/QDateTime>
#include <QtCore/QVector>

namespace Quotient {
struct Receipt {
    QString userId;
    QDateTime timestamp;
};
struct ReceiptsForEvent {
    QString evtId;
    QVector<Receipt> receipts;
};
using EventsWithReceipts = QVector<ReceiptsForEvent>;

class ReceiptEvent : public Event {
public:
    DEFINE_EVENT_TYPEID("m.receipt", ReceiptEvent)
    explicit ReceiptEvent(const QJsonObject& obj) : Event(typeId(), obj) {}

    EventsWithReceipts eventsWithReceipts() const;
};
REGISTER_EVENT_TYPE(ReceiptEvent)
} // namespace Quotient