summary refs log tree commit diff
path: root/include/AvatarProvider.h
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-06-09 16:03:14 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-06-09 16:03:14 +0300
commitb89257a34b2a98b737f4ae544f7e436b9000b240 (patch)
tree81d7f355721541afbd91dc9a085abbb4666f3565 /include/AvatarProvider.h
parentInstall missing dependencies in travis-ci/appveyor (diff)
downloadnheko-b89257a34b2a98b737f4ae544f7e436b9000b240.tar.xz
Migrate to mtxclient for the http calls
Diffstat (limited to 'include/AvatarProvider.h')
-rw-r--r--include/AvatarProvider.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/include/AvatarProvider.h b/include/AvatarProvider.h

index ce82f2aa..4b4e15e9 100644 --- a/include/AvatarProvider.h +++ b/include/AvatarProvider.h
@@ -20,15 +20,17 @@ #include <QImage> #include <functional> -class AvatarProvider : public QObject +class AvatarProxy : public QObject { Q_OBJECT -public: - //! The callback is called with the downloaded avatar for the given user - //! or the avatar is downloaded first and then saved for re-use. - static void resolve(const QString &room_id, - const QString &userId, - QObject *receiver, - std::function<void(QImage)> callback); +signals: + void avatarDownloaded(const QByteArray &data); }; + +using AvatarCallback = std::function<void(QImage)>; + +namespace AvatarProvider { +void +resolve(const QString &room_id, const QString &user_id, QObject *receiver, AvatarCallback cb); +}