moment/harmonyqml/components/Chat/Banners/InviteBanner.qml
miruka 51386821bc Make clientManager easier to use
- Backend.clientManager renamed to Backend.clients
- clientManager is now a Mapping subclass

Before/After from Python:
backend.clientManager.clients[thing] → backend.clients[thing]

From QML:
Backend.clientManager.clients[thing] → Backend.clients.get(thing)
2019-05-02 14:58:42 -04:00

42 lines
1010 B
QML

import QtQuick 2.7
import "../../Base"
Banner {
property var inviter: null
color: HStyle.chat.inviteBanner.background
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: [
{
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)
}
}
}