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 {
|
|
|
|
property var inviter: null
|
|
|
|
|
2019-04-29 05:18:36 +10:00
|
|
|
color: HStyle.chat.inviteBanner.background
|
2019-04-29 01:01:38 +10:00
|
|
|
|
2019-05-09 03:45:25 +10:00
|
|
|
avatar.name: inviter ? inviter.displayname : ""
|
|
|
|
//avatar.imageSource: inviter ? inviter.avatar_url : ""
|
2019-04-22 05:20:20 +10:00
|
|
|
|
|
|
|
labelText:
|
|
|
|
(inviter ?
|
|
|
|
("<b>" + inviter.displayname + "</b>") : qsTr("Someone")) +
|
|
|
|
" " + qsTr("invited you to join the room.")
|
|
|
|
|
|
|
|
buttonModel: [
|
|
|
|
{
|
2019-04-29 04:20:30 +10:00
|
|
|
name: "accept",
|
|
|
|
text: qsTr("Accept"),
|
2019-04-27 06:02:20 +10:00
|
|
|
iconName: "invite_accept",
|
2019-04-22 05:20:20 +10:00
|
|
|
},
|
|
|
|
{
|
2019-04-29 04:20:30 +10:00
|
|
|
name: "decline",
|
|
|
|
text: qsTr("Decline"),
|
2019-04-27 06:02:20 +10:00
|
|
|
iconName: "invite_decline",
|
2019-04-22 05:20:20 +10:00
|
|
|
}
|
|
|
|
]
|
2019-04-29 04:20:30 +10:00
|
|
|
|
|
|
|
buttonCallbacks: {
|
|
|
|
"accept": function(button) {
|
|
|
|
button.loading = true
|
2019-05-03 04:54:37 +10:00
|
|
|
Backend.clients.get(chatPage.userId).joinRoom(chatPage.roomId)
|
2019-04-29 04:20:30 +10:00
|
|
|
},
|
|
|
|
|
|
|
|
"decline": function(button) {
|
|
|
|
button.loading = true
|
2019-05-03 04:54:37 +10:00
|
|
|
Backend.clients.get(chatPage.userId).leaveRoom(chatPage.roomId)
|
2019-04-29 04:20:30 +10:00
|
|
|
}
|
|
|
|
}
|
2019-04-22 05:20:20 +10:00
|
|
|
}
|