libQuotient
A Qt library for building matrix clients
Loading...
Searching...
No Matches
receiptevent.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2018 Kitsune Ral <Kitsune-Ral@users.sf.net>
2// SPDX-License-Identifier: LGPL-2.1-or-later
3
4#pragma once
5
6#include "event.h"
7
8#include <QtCore/QDateTime>
9#include <QtCore/QVector>
10
11namespace Quotient {
12struct UserTimestamp {
13 QString userId;
14 QDateTime timestamp;
15};
16struct ReceiptsForEvent {
17 QString evtId;
18 QVector<UserTimestamp> receipts;
19};
20using EventsWithReceipts = QVector<ReceiptsForEvent>;
21
22template <>
23QUOTIENT_API EventsWithReceipts fromJson(const QJsonObject& json);
24QUOTIENT_API QJsonObject toJson(const EventsWithReceipts& ewrs);
25
26class QUOTIENT_API ReceiptEvent
27 : public EventTemplate<ReceiptEvent, Event, EventsWithReceipts> {
28public:
29 QUO_EVENT(ReceiptEvent, "m.receipt")
30 using EventTemplate::EventTemplate;
31};
32} // namespace Quotient
#define QUO_EVENT(CppType_, MatrixType_)
Supply event metatype information in (specific) event types.
Definition event.h:436
#define QUOTIENT_API