Crete a proxy for media to uniquely match signal to the caller

This commit is contained in:
Konstantinos Sideris 2018-03-07 21:23:57 +02:00
parent ea22bdce18
commit 39abf163b8
7 changed files with 57 additions and 48 deletions

View file

@ -22,6 +22,15 @@
#include <QUrl>
#include <mtx.hpp>
class DownloadMediaProxy : public QObject
{
Q_OBJECT
signals:
void imageDownloaded(const QPixmap &data);
void fileDownloaded(const QByteArray &data);
};
/*
* MatrixClient provides the high level API to communicate with
* a Matrix homeserver. All the responses are returned through signals.
@ -55,8 +64,8 @@ public:
void fetchCommunityAvatar(const QString &communityId, const QUrl &avatarUrl);
void fetchCommunityProfile(const QString &communityId);
void fetchCommunityRooms(const QString &communityId);
void downloadImage(const QString &event_id, const QUrl &url);
void downloadFile(const QString &event_id, const QUrl &url);
DownloadMediaProxy *downloadImage(const QUrl &url);
DownloadMediaProxy *downloadFile(const QUrl &url);
void messages(const QString &room_id, const QString &from_token, int limit = 30) noexcept;
void uploadImage(const QString &roomid,
const QString &filename,
@ -140,8 +149,6 @@ signals:
void communityAvatarRetrieved(const QString &communityId, const QPixmap &img);
void communityProfileRetrieved(const QString &communityId, const QJsonObject &profile);
void communityRoomsRetrieved(const QString &communityId, const QJsonObject &rooms);
void imageDownloaded(const QString &event_id, const QPixmap &img);
void fileDownloaded(const QString &event_id, const QByteArray &data);
// Returned profile data for the user's account.
void getOwnProfileResponse(const QUrl &avatar_url, const QString &display_name);