diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-01-25 19:48:08 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-01-25 19:48:08 +0900 |
commit | 80f7e44e1a9056fc55147718dd2812eb93925ec1 (patch) | |
tree | b6d1014f736b8c75e05e1dea8157e7ed04cc7820 /room.cpp | |
parent | 3a913f33853c675a1051460bc36278be20a4c941 (diff) | |
download | libquotient-80f7e44e1a9056fc55147718dd2812eb93925ec1.tar.gz libquotient-80f7e44e1a9056fc55147718dd2812eb93925ec1.zip |
Room, User: expose avatarMediaId(); declare User for the metatype system
To make it easy to use User objects and fetch room and user avatars from QML. Closes #155.
Diffstat (limited to 'room.cpp')
-rw-r--r-- | room.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -263,6 +263,11 @@ QString Room::topic() const return d->topic; } +QString Room::avatarMediaId() const +{ + return d->avatar.mediaId(); +} + QUrl Room::avatarUrl() const { return d->avatar.url(); @@ -284,8 +289,8 @@ QImage Room::avatar(int width, int height) auto theOtherOneIt = d->membersMap.begin(); if (theOtherOneIt.value() == localUser()) ++theOtherOneIt; - return theOtherOneIt.value()->avatarObject() - .get(width, height, [=] { emit avatarChanged(); }); + return (*theOtherOneIt)->avatarObject() + .get(width, height, [=] { emit avatarChanged(); }); } return {}; } |