2019-04-22 05:20:20 +10:00
|
|
|
import QtQuick 2.7
|
|
|
|
import QtQuick.Controls 2.2
|
|
|
|
import QtQuick.Layouts 1.4
|
2019-04-29 04:34:29 +10:00
|
|
|
import "../../Base" as Base
|
2019-04-22 05:20:20 +10:00
|
|
|
|
|
|
|
Banner {
|
|
|
|
property var inviter: null
|
|
|
|
|
2019-04-29 01:01:38 +10:00
|
|
|
color: Base.HStyle.chat.inviteBanner.background
|
|
|
|
|
2019-04-22 05:20:20 +10:00
|
|
|
avatarName: inviter ? inviter.displayname : ""
|
|
|
|
//avatarSource: inviter ? inviter.avatar_url : ""
|
|
|
|
|
|
|
|
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
|
|
|
|
Backend.clientManager.clients[chatPage.userId].joinRoom(
|
|
|
|
chatPage.roomId
|
|
|
|
)
|
|
|
|
},
|
|
|
|
|
|
|
|
"decline": function(button) {
|
|
|
|
button.loading = true
|
|
|
|
Backend.clientManager.clients[chatPage.userId].leaveRoom(
|
|
|
|
chatPage.roomId
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
2019-04-22 05:20:20 +10:00
|
|
|
}
|