libQuotient
A Qt library for building matrix clients
Loading...
Searching...
No Matches
eventrelation.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2022 Kitsune Ral <kitsune-ral@users.sf.net>
2// SPDX-License-Identifier: LGPL-2.1-or-later
3
4#pragma once
5
6#include <Quotient/converters.h>
7
8namespace Quotient {
9
10constexpr inline auto RelatesToKey = "m.relates_to"_L1;
11constexpr inline auto RelTypeKey = "rel_type"_L1;
12constexpr inline auto IsFallingBackKey = "is_falling_back"_L1;
13
16
19 QString key = {}; // Only used for m.annotation for now
20 bool isFallingBack = false;
21 // Only used for m.thread to provide the reply event fallback for non-threaded clients
22 // or to allow a reply within the thread.
24
25 static constexpr auto ReplyType = "m.in_reply_to"_L1;
26 static constexpr auto AnnotationType = "m.annotation"_L1;
27 static constexpr auto ReplacementType = "m.replace"_L1;
28 static constexpr auto ThreadType = "m.thread"_L1;
29
31 {
32 return { ReplyType, std::move(eventId) };
33 }
35 {
36 return { AnnotationType, std::move(eventId), std::move(key) };
37 }
39 {
40 return { ReplacementType, std::move(eventId) };
41 }
44 {
45 return {
47 };
48 }
49};
50
51template <>
53 static void dumpTo(QJsonObject& jo, const EventRelation& pod);
54 static void fillFrom(const QJsonObject& jo, EventRelation& pod);
55};
56
57} // namespace Quotient
constexpr auto IsFallingBackKey
constexpr auto RelTypeKey
constexpr auto RelatesToKey
#define QUOTIENT_API