moment/src/qml/Base/HRoomAvatar.qml

20 lines
645 B
QML
Raw Normal View History

2019-07-08 13:52:41 +10:00
// Copyright 2019 miruka
// This file is part of harmonyqml, licensed under LGPLv3.
import QtQuick 2.12
HAvatar {
2019-07-18 16:36:08 +10:00
property string userId: ""
property string roomId: ""
readonly property var roomInfo: rooms.getWhere({userId, roomId}, 1)[0]
2019-07-18 16:36:08 +10:00
// Avoid error messages when a room is forgotten
2019-07-08 12:19:17 +10:00
readonly property var dname: roomInfo ? roomInfo.displayName : ""
readonly property var avUrl: roomInfo ? roomInfo.avatarUrl : ""
2019-07-08 12:19:17 +10:00
name: dname[0] == "#" && dname.length > 1 ? dname.substring(1) : dname
imageUrl: avUrl ? ("image://python/" + avUrl) : null
toolTipImageUrl: avUrl ? ("image://python/" + avUrl) : null
}