2019-04-21 15:20:20 -04:00
|
|
|
import QtQuick 2.7
|
2019-04-28 15:18:36 -04:00
|
|
|
import "../../Base"
|
2019-07-06 23:43:51 -04:00
|
|
|
import "../../utils.js" as Utils
|
2019-04-21 15:20:20 -04:00
|
|
|
|
|
|
|
Banner {
|
2019-07-06 23:43:51 -04:00
|
|
|
property string userId: ""
|
|
|
|
readonly property var userInfo: users.getUser(userId)
|
2019-04-21 15:20:20 -04:00
|
|
|
|
2019-07-06 17:50:55 -04:00
|
|
|
color: theme.chat.leftBanner.background
|
2019-04-28 11:01:38 -04:00
|
|
|
|
2019-07-06 23:43:51 -04: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.")
|
2019-04-21 15:20:20 -04:00
|
|
|
|
|
|
|
buttonModel: [
|
|
|
|
{
|
2019-04-28 14:20:30 -04:00
|
|
|
name: "forget",
|
|
|
|
text: qsTr("Forget"),
|
2019-04-26 16:02:20 -04:00
|
|
|
iconName: "forget_room",
|
2019-04-21 15:20:20 -04:00
|
|
|
}
|
|
|
|
]
|
2019-04-28 14:20:30 -04:00
|
|
|
|
|
|
|
buttonCallbacks: {
|
|
|
|
"forget": function(button) {
|
|
|
|
button.loading = true
|
2019-07-06 23:43:51 -04:00
|
|
|
py.callClientCoro(
|
|
|
|
chatPage.userId, "room_forget", [chatPage.roomId], {},
|
|
|
|
function() {
|
|
|
|
button.loading = false
|
|
|
|
pageStack.clear()
|
|
|
|
}
|
|
|
|
)
|
2019-04-28 14:20:30 -04:00
|
|
|
},
|
|
|
|
}
|
2019-04-21 15:20:20 -04:00
|
|
|
}
|