From baee19241daffd50e0b32559cda64d5b6ede09a2 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Tue, 13 Jun 2017 17:30:13 +0900 Subject: Initial support for local echo The Room class has gained a new internal container, unsyncedEvents, storing locally-created Event objects that are about to be sent or are sent but not yet synced. These objects are supposed to be complete enough to be displayed by clients in a usual way; access to them is provided by Room::pendingEvents() accessor. A set of pendingEvent* signals has been added to notify clients about changes in this container (adding, removal, status update). Yet unsent events don't have Event::id() at all; sent but yet unsynced ones have Event::id() but have almost nothing else except the content for now (probably a sender and an (at least local) timestamp are worth adding). Also: SendEventJob is removed in favor of GTAD-generated SendMessageJob. --- lib/events/roomevent.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/events/roomevent.cpp') diff --git a/lib/events/roomevent.cpp b/lib/events/roomevent.cpp index 3d09af8a..75850772 100644 --- a/lib/events/roomevent.cpp +++ b/lib/events/roomevent.cpp @@ -75,6 +75,11 @@ QString RoomEvent::redactionReason() const return isRedacted() ? _redactedBecause->reason() : QString{}; } +QString RoomEvent::stateKey() const +{ + return fullJson()["state_key"_ls].toString(); +} + void RoomEvent::addId(const QString& newId) { Q_ASSERT(id().isEmpty()); Q_ASSERT(!newId.isEmpty()); -- cgit v1.2.3