moment/src/qml/Chat/Banners/LeftBanner.qml

37 lines
932 B
QML
Raw Normal View History

import QtQuick 2.7
import "../../Base"
import "../../utils.js" as Utils
Banner {
property string userId: ""
readonly property var userInfo: users.getUser(userId)
color: theme.chat.leftBanner.background
2019-04-29 01:01:38 +10:00
// TODO: avatar func auto
avatar.name: userInfo.displayName || Utils.stripUserId(userId)
avatar.imageUrl: users.getUser(userId).avatarUrl
labelText: qsTr("You are not part of this room anymore.")
buttonModel: [
{
name: "forget",
text: qsTr("Forget"),
2019-04-27 06:02:20 +10:00
iconName: "forget_room",
}
]
buttonCallbacks: {
"forget": function(button) {
button.loading = true
py.callClientCoro(
chatPage.userId, "room_forget", [chatPage.roomId], {},
function() {
button.loading = false
pageStack.clear()
}
)
},
}
}