From ed28e010c6423ccec730ca581b8d6d48c2c6cd17 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 3 Aug 2018 20:22:27 +0900 Subject: RoomEvent: fix wrong JSON key to pick/store transaction id --- lib/events/roomevent.cpp | 4 ++-- lib/events/roomevent.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/events/roomevent.cpp b/lib/events/roomevent.cpp index 738a5f58..e9d74cf6 100644 --- a/lib/events/roomevent.cpp +++ b/lib/events/roomevent.cpp @@ -77,7 +77,7 @@ QString RoomEvent::redactionReason() const QString RoomEvent::transactionId() const { - return unsignedJson()["transactionId"_ls].toString(); + return unsignedJson()["transaction_id"_ls].toString(); } QString RoomEvent::stateKey() const @@ -88,7 +88,7 @@ QString RoomEvent::stateKey() const void RoomEvent::setTransactionId(const QString& txnId) { auto unsignedData = fullJson()[UnsignedKeyL].toObject(); - unsignedData.insert(QStringLiteral("transactionId"), txnId); + unsignedData.insert(QStringLiteral("transaction_id"), txnId); editJson().insert(UnsignedKey, unsignedData); qCDebug(EVENTS) << "New event transactionId:" << txnId; Q_ASSERT(transactionId() == txnId); diff --git a/lib/events/roomevent.h b/lib/events/roomevent.h index a345d176..f057753f 100644 --- a/lib/events/roomevent.h +++ b/lib/events/roomevent.h @@ -22,7 +22,8 @@ #include -namespace QMatrixClient { +namespace QMatrixClient +{ class RedactionEvent; /** This class corresponds to m.room.* events */ -- cgit v1.2.3