8 #include <QtCore/QDateTime>
12 constexpr inline auto EventIdKey =
"event_id"_L1;
13 constexpr inline auto RoomIdKey =
"room_id"_L1;
14 constexpr inline auto StateKeyKey =
"state_key"_L1;
15 constexpr inline auto RedactedCauseKey =
"redacted_because"_L1;
26 ~RoomEvent() override;
32 QString displayId()
const;
37 QDateTime originTimestamp()
const;
38 QString roomId()
const;
39 QString senderId()
const;
40 bool isRedacted()
const {
return bool(_redactedBecause); }
41 const event_ptr_tt<RedactionEvent>& redactedBecause()
const
43 return _redactedBecause;
45 QString redactionReason()
const;
48 QString transactionId()
const;
54 bool isStateEvent()
const;
56 QString stateKey()
const;
59 void setRoomId(
const QString& roomId);
61 void setSender(
const QString& senderId);
65 void setTransactionId(
const QString& txnId);
75 void addId(
const QString& newId);
77 void setOriginalEvent(event_ptr_tt<EncryptedEvent>&& originalEvent);
78 const EncryptedEvent* originalEvent()
const {
return _originalEvent.get(); }
79 const QJsonObject encryptedJson()
const;
82 explicit RoomEvent(
const QJsonObject& json);
83 void dumpTo(QDebug dbg)
const override;
88 event_ptr_tt<RedactionEvent> _redactedBecause;
90 event_ptr_tt<EncryptedEvent> _originalEvent;
92 using RoomEventPtr = event_ptr_tt<RoomEvent>;
93 using RoomEvents = EventsArray<RoomEvent>;
94 using RoomEventsRange = std::ranges::subrange<RoomEvents::iterator>;
100 Q_DECLARE_METATYPE(Quotient::RoomEvent*)
101 Q_DECLARE_METATYPE(
const Quotient::RoomEvent*)