diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-09-09 19:27:57 +0200 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-09-09 19:31:18 +0200 |
commit | 9e548e0625a819052cd10d5c4bf129dde649a6a4 (patch) | |
tree | 6af4eafbf708302f1da3564dfcc4868ac37f599e /lib/room.h | |
parent | 9ec9f5c05ff32779c5ea76423adbe05487f37fa9 (diff) | |
download | libquotient-9e548e0625a819052cd10d5c4bf129dde649a6a4.tar.gz libquotient-9e548e0625a819052cd10d5c4bf129dde649a6a4.zip |
Straighten up file transfer cancellation
There was a mess with fileTransferCancelled(); it was only emitted when
a download (but not an upload) was cancelled; besides, in case of
downloads a file transfer info structure was getting deleted whereas
uploads left a file transfer in Cancelled status. This all now converges
on:
- fileTransferFailed() for both failures and cancellations (to simplify
slot connection, and also to follow the practice in, e.g., Qt Network).
- the file transfer info structure is kept around in Cancelled status,
following the logic used for failures. There's no particular cleanup
which may become a problem if one uploads and cancels many times
(download file transfers are keyed to event ids, mitigating
the problem); this will be fixed in another commit.
Closes #503. Closes #504.
Diffstat (limited to 'lib/room.h')
-rw-r--r-- | lib/room.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -712,7 +712,8 @@ Q_SIGNALS: void fileTransferProgress(QString id, qint64 progress, qint64 total); void fileTransferCompleted(QString id, QUrl localFile, QUrl mxcUrl); void fileTransferFailed(QString id, QString errorMessage = {}); - void fileTransferCancelled(QString id); + // fileTransferCancelled() is no more here; use fileTransferFailed() and + // check the transfer status instead void callEvent(Quotient::Room* room, const Quotient::RoomEvent* event); |