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/connection.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/connection.h') diff --git a/lib/connection.h b/lib/connection.h index 7adab883..48ca2232 100644 --- a/lib/connection.h +++ b/lib/connection.h @@ -47,6 +47,7 @@ namespace QMatrixClient class GetContentJob; class DownloadFileJob; class SendToDeviceJob; + class SendMessageJob; /** Create a single-shot connection that triggers on the signal and * then self-disconnects @@ -421,11 +422,11 @@ namespace QMatrixClient SendToDeviceJob* sendToDevices(const QString& eventType, const UsersToDevicesToEvents& eventsMap) const; + SendMessageJob* sendMessage(const QString& roomId, + const RoomEvent& event) const; + // Old API that will be abolished any time soon. DO NOT USE. - /** @deprecated Use callApi() or Room::postMessage() instead */ - virtual void postMessage(Room* room, const QString& type, - const QString& message) const; /** @deprecated Use callApi() or Room::postReceipt() instead */ virtual PostReceiptJob* postReceipt(Room* room, RoomEvent* event) const; -- cgit v1.2.3