Set a button to open chat from contact details

This commit is contained in:
Angela Mazzurco 2017-07-21 18:48:23 +02:00
parent c27db173ce
commit 0ca3e35e33

View File

@ -33,15 +33,25 @@ Item
{ {
id: avatarPicker id: avatarPicker
text: "Change your Avatar" text: (isOwn)? qsTr("Change your Avatar") : qsTr("Start Chat!")
visible: isOwn
anchors.top: parent.top anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
onClicked: onClicked:
{ {
fileChooser.open() if (isOwn) fileChooser.open()
else startDistantChat ()
}
function startDistantChat ()
{
ChatCache.chatHelper.startDistantChat(ChatCache.contactsCache.own.gxs_id,
cntDt.md.gxs_id,
cntDt.md.name,
function (chatId)
{
stackView.push("qrc:/ChatView.qml", {'chatId': chatId})
})
} }
CustomFileChooser CustomFileChooser
{ {
@ -73,7 +83,7 @@ Item
gxs_id: cntDt.md.gxs_id gxs_id: cntDt.md.gxs_id
anchors.top: (isOwn)? avatarPicker.bottom : parent.top anchors.top: avatarPicker.bottom
anchors.topMargin: 6 anchors.topMargin: 6
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
} }