2019-07-07 23:52:41 -04:00
|
|
|
// Copyright 2019 miruka
|
|
|
|
// This file is part of harmonyqml, licensed under LGPLv3.
|
|
|
|
|
2019-07-13 05:39:01 -04:00
|
|
|
import QtQuick 2.12
|
2019-07-07 00:24:23 -04:00
|
|
|
|
|
|
|
HAvatar {
|
|
|
|
property string roomId: ""
|
|
|
|
|
2019-07-07 22:19:17 -04:00
|
|
|
// roomInfo ? → Avoid error messages when a room is forgotten
|
2019-07-07 00:24:23 -04:00
|
|
|
readonly property var roomInfo: rooms.getWhere({"roomId": roomId}, 1)[0]
|
2019-07-07 22:19:17 -04:00
|
|
|
readonly property var dname: roomInfo ? roomInfo.displayName : ""
|
|
|
|
|
2019-07-09 21:54:53 -04:00
|
|
|
name:
|
|
|
|
dname[0] == "#" && dname.length > 1 ? dname.substring(1) : dname
|
|
|
|
|
|
|
|
imageUrl:
|
|
|
|
roomInfo.avatarUrl ?
|
2019-07-09 22:48:59 -04:00
|
|
|
("image://python/crop/" + roomInfo.avatarUrl) : null
|
|
|
|
|
|
|
|
toolTipImageUrl:
|
|
|
|
roomInfo.avatarUrl ?
|
|
|
|
("image://python/scale/" + roomInfo.avatarUrl) : null
|
2019-07-07 00:24:23 -04:00
|
|
|
}
|