aboutsummaryrefslogtreecommitdiff
path: root/lib/room.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/room.cpp')
-rw-r--r--lib/room.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/room.cpp b/lib/room.cpp
index 60c61f2b..e1625478 100644
--- a/lib/room.cpp
+++ b/lib/room.cpp
@@ -30,6 +30,8 @@
#include "csapi/rooms.h"
#include "csapi/tags.h"
#include "events/simplestateevents.h"
+#include "events/roomcreateevent.h"
+#include "events/roomtombstoneevent.h"
#include "events/roomavatarevent.h"
#include "events/roommemberevent.h"
#include "events/typingevent.h"
@@ -315,6 +317,21 @@ const QString& Room::id() const
return d->id;
}
+QString Room::version() const
+{
+ return d->getCurrentState<RoomCreateEvent>()->version();
+}
+
+QString Room::predecessorId() const
+{
+ return d->getCurrentState<RoomCreateEvent>()->predecessor().roomId;
+}
+
+QString Room::successorId() const
+{
+ return d->getCurrentState<RoomTombstoneEvent>()->successorRoomId();
+}
+
const Room::Timeline& Room::messageEvents() const
{
return d->timeline;
@@ -1807,7 +1824,7 @@ RoomEventPtr makeRedacted(const RoomEvent& target,
std::vector<std::pair<Event::Type, QStringList>> keepContentKeysMap
{ { RoomMemberEvent::typeId(), { QStringLiteral("membership") } }
-// , { RoomCreateEvent::typeId(), { QStringLiteral("creator") } }
+ , { RoomCreateEvent::typeId(), { QStringLiteral("creator") } }
// , { RoomJoinRules::typeId(), { QStringLiteral("join_rule") } }
// , { RoomPowerLevels::typeId(),
// { QStringLiteral("ban"), QStringLiteral("events"),