diff options
Diffstat (limited to 'lib/connection.h')
-rw-r--r-- | lib/connection.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/connection.h b/lib/connection.h index 2c4c622d..5bf8e5ac 100644 --- a/lib/connection.h +++ b/lib/connection.h @@ -45,6 +45,8 @@ namespace QMatrixClient class UploadContentJob; class GetContentJob; class DownloadFileJob; + class SendToDeviceJob; + class Event; /** Enumeration with flags defining the network job running policy * So far only background/foreground flags are available. @@ -77,6 +79,10 @@ namespace QMatrixClient QT_VERSION >= QT_VERSION_CHECK(5, 5, 0), QVariantHash, QVariantMap>; + using UsersToDevicesToEvents = + std::unordered_map<QString, + std::unordered_map<QString, const Event&>>; + enum RoomVisibility { PublishRoom, UnpublishRoom }; // FIXME: Should go inside CreateRoomJob explicit Connection(QObject* parent = nullptr); @@ -234,7 +240,7 @@ namespace QMatrixClient /** Generates a new transaction id. Transaction id's are unique within * a single Connection object */ - Q_INVOKABLE QByteArray generateTxnId(); + Q_INVOKABLE QByteArray generateTxnId() const; template <typename T = Room> static void setRoomType() @@ -347,6 +353,9 @@ namespace QMatrixClient */ ForgetRoomJob* forgetRoom(const QString& id); + SendToDeviceJob* sendToDevices(const QString& eventType, + const UsersToDevicesToEvents& eventsMap) const; + // Old API that will be abolished any time soon. DO NOT USE. /** @deprecated Use callApi<PostMessageJob>() or Room::postMessage() instead */ |