7b3b886f10
The banner replaces the SendBox, to prevent sending messages when nio will raise an OlmTrustError.
42 lines
1017 B
QML
42 lines
1017 B
QML
import QtQuick 2.7
|
|
import "../../Base"
|
|
|
|
Banner {
|
|
property var inviter: null
|
|
|
|
color: HStyle.chat.inviteBanner.background
|
|
|
|
avatar.name: inviter ? inviter.displayname : ""
|
|
//avatar.imageSource: inviter ? inviter.avatar_url : ""
|
|
|
|
labelText:
|
|
(inviter ?
|
|
("<b>" + inviter.displayname + "</b>") : qsTr("Someone")) +
|
|
" " + qsTr("invited you to join the room.")
|
|
|
|
buttonModel: [
|
|
{
|
|
name: "accept",
|
|
text: qsTr("Accept"),
|
|
iconName: "invite_accept",
|
|
},
|
|
{
|
|
name: "decline",
|
|
text: qsTr("Decline"),
|
|
iconName: "invite_decline",
|
|
}
|
|
]
|
|
|
|
buttonCallbacks: {
|
|
"accept": function(button) {
|
|
button.loading = true
|
|
Backend.clients.get(chatPage.userId).joinRoom(chatPage.roomId)
|
|
},
|
|
|
|
"decline": function(button) {
|
|
button.loading = true
|
|
Backend.clients.get(chatPage.userId).leaveRoom(chatPage.roomId)
|
|
}
|
|
}
|
|
}
|