From 36f63f398b8a36e0b276e78eceaf3c4123be6b13 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Mon, 8 Jul 2019 19:36:27 +0900 Subject: RoomEvent::setRoomId()/setSender() --- lib/events/roomevent.cpp | 10 ++++++++++ lib/events/roomevent.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/lib/events/roomevent.cpp b/lib/events/roomevent.cpp index 62c2a76d..f1e563ff 100644 --- a/lib/events/roomevent.cpp +++ b/lib/events/roomevent.cpp @@ -81,6 +81,16 @@ QString RoomEvent::stateKey() const return fullJson()[StateKeyKeyL].toString(); } +void RoomEvent::setRoomId(const QString& roomId) +{ + editJson().insert(QStringLiteral("room_id"), roomId); +} + +void RoomEvent::setSender(const QString& senderId) +{ + editJson().insert(QStringLiteral("sender"), senderId); +} + void RoomEvent::setTransactionId(const QString& txnId) { auto unsignedData = fullJson()[UnsignedKeyL].toObject(); diff --git a/lib/events/roomevent.h b/lib/events/roomevent.h index ce96174e..e26a7135 100644 --- a/lib/events/roomevent.h +++ b/lib/events/roomevent.h @@ -60,6 +60,9 @@ namespace QMatrixClient QString transactionId() const; QString stateKey() const; + void setRoomId(const QString& roomId); + void setSender(const QString& senderId); + /** * Sets the transaction id for locally created events. This should be * done before the event is exposed to any code using the respective -- cgit v1.2.3