File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 1111
1212using namespace Quotient ;
1313
14- RoomEvent::RoomEvent (const QJsonObject& json) : Event(json)
14+ RoomEvent::RoomEvent (const QJsonObject & json) : Event(json), _id(fullJson()[EventIdKey].toString() )
1515{
1616 if (const auto redaction = unsignedPart<QJsonObject>(RedactedCauseKey);
1717 !redaction.isEmpty ())
@@ -22,7 +22,7 @@ RoomEvent::~RoomEvent() = default; // Let the smart pointer do its job
2222
2323QString RoomEvent::displayId () const { return id ().isEmpty () ? transactionId () : id (); }
2424
25- QString RoomEvent::id () const { return fullJson ()[EventIdKey]. toString () ; }
25+ QString RoomEvent::id () const { return _id ; }
2626
2727QDateTime RoomEvent::originTimestamp () const
2828{
@@ -79,6 +79,7 @@ void RoomEvent::addId(const QString& newId)
7979 Q_ASSERT (id ().isEmpty ());
8080 Q_ASSERT (!newId.isEmpty ());
8181 editJson ().insert (EventIdKey, newId);
82+ _id = newId;
8283 qCDebug (EVENTS) << " Event txnId -> id:" << transactionId () << " ->" << id ();
8384 Q_ASSERT (id () == newId);
8485}
Original file line number Diff line number Diff line change @@ -131,6 +131,8 @@ class QUOTIENT_API RoomEvent : public Event {
131131 void dumpTo (QDebug dbg) const override ;
132132
133133private:
134+ QString _id;
135+
134136 // RedactionEvent is an incomplete type here so we cannot inline
135137 // constructors using it and also destructors (with 'using', in particular).
136138 event_ptr_tt<RedactionEvent> _redactedBecause;
You can’t perform that action at this time.
0 commit comments