2019-04-22 05:20:20 +10:00
|
|
|
import QtQuick 2.7
|
2019-04-29 05:18:36 +10:00
|
|
|
import "../../Base"
|
2019-04-22 05:20:20 +10:00
|
|
|
|
|
|
|
Banner {
|
2019-07-07 13:43:51 +10:00
|
|
|
property string userId: ""
|
2019-07-08 12:41:32 +10:00
|
|
|
readonly property var userInfo: users.find(userId)
|
2019-04-22 05:20:20 +10:00
|
|
|
|
2019-07-07 07:50:55 +10:00
|
|
|
color: theme.chat.leftBanner.background
|
2019-04-29 01:01:38 +10:00
|
|
|
|
2019-07-07 13:43:51 +10:00
|
|
|
// TODO: avatar func auto
|
2019-07-07 14:24:23 +10:00
|
|
|
avatar.userId: userId
|
2019-07-08 12:49:28 +10:00
|
|
|
avatar.imageUrl: userInfo ? userInfo.avatarUrl : null
|
2019-07-07 13:43:51 +10:00
|
|
|
labelText: qsTr("You are not part of this room anymore.")
|
2019-04-22 05:20:20 +10:00
|
|
|
|
|
|
|
buttonModel: [
|
|
|
|
{
|
2019-04-29 04:20:30 +10:00
|
|
|
name: "forget",
|
|
|
|
text: qsTr("Forget"),
|
2019-04-27 06:02:20 +10:00
|
|
|
iconName: "forget_room",
|
2019-04-22 05:20:20 +10:00
|
|
|
}
|
|
|
|
]
|
2019-04-29 04:20:30 +10:00
|
|
|
|
|
|
|
buttonCallbacks: {
|
|
|
|
"forget": function(button) {
|
|
|
|
button.loading = true
|
2019-07-07 13:43:51 +10:00
|
|
|
py.callClientCoro(
|
2019-07-08 13:38:37 +10:00
|
|
|
chatPage.userId, "room_forget", [chatPage.roomId], function() {
|
|
|
|
button.loading = false
|
|
|
|
})
|
2019-07-08 12:19:17 +10:00
|
|
|
}
|
2019-04-29 04:20:30 +10:00
|
|
|
}
|
2019-04-22 05:20:20 +10:00
|
|
|
}
|