aboutsummaryrefslogtreecommitdiff
path: root/avatar.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-01-25 19:48:08 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-01-25 19:48:08 +0900
commit80f7e44e1a9056fc55147718dd2812eb93925ec1 (patch)
treeb6d1014f736b8c75e05e1dea8157e7ed04cc7820 /avatar.cpp
parent3a913f33853c675a1051460bc36278be20a4c941 (diff)
downloadlibquotient-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 'avatar.cpp')
-rw-r--r--avatar.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/avatar.cpp b/avatar.cpp
index 44cad4e5..040bf9bb 100644
--- a/avatar.cpp
+++ b/avatar.cpp
@@ -62,6 +62,11 @@ QImage Avatar::get(int width, int height, notifier_t notifier) const
return d->get({width, height}, notifier);
}
+QString Avatar::mediaId() const
+{
+ return d->_url.authority() + d->_url.path();
+}
+
QImage Avatar::Private::get(QSize size, Avatar::notifier_t notifier) const
{
// FIXME: Alternating between longer-width and longer-height requests