6 #include <Quotient/converters.h>
10 constexpr inline auto RelatesToKey =
"m.relates_to"_L1;
11 constexpr inline auto RelTypeKey =
"rel_type"_L1;
12 constexpr inline auto IsFallingBackKey =
"is_falling_back"_L1;
15 using reltypeid_t = QLatin1String;
20 bool isFallingBack =
false;
23 QString inThreadReplyEventId = {};
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;
30 static EventRelation replyTo(QString eventId)
32 return { ReplyType, std::move(eventId) };
34 static EventRelation annotate(QString eventId, QString key)
36 return { AnnotationType, std::move(eventId), std::move(key) };
38 static EventRelation replace(QString eventId)
40 return { ReplacementType, std::move(eventId) };
42 static EventRelation replyInThread(QString threadRootId,
bool isFallingBack,
43 QString inThreadReplyEventId)
46 ThreadType, std::move(threadRootId), {}, isFallingBack, std::move(inThreadReplyEventId)
53 static void dumpTo(QJsonObject& jo,
const EventRelation& pod);
54 static void fillFrom(
const QJsonObject& jo, EventRelation& pod);