2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2020-05-28 12:56:43 +00:00
|
|
|
import "../../../../imports"
|
|
|
|
import "../../../../shared"
|
2020-11-13 15:28:27 +00:00
|
|
|
import "../../../../shared/status"
|
2020-05-28 12:56:43 +00:00
|
|
|
import "./"
|
|
|
|
|
2020-05-29 16:27:50 +00:00
|
|
|
ModalPopup {
|
2021-02-08 12:21:23 +00:00
|
|
|
function doJoin(pk, ensName) {
|
|
|
|
if(Utils.isChatKey(pk)){
|
|
|
|
chatsModel.joinChat(pk, Constants.chatTypeOneToOne);
|
2020-11-17 14:37:00 +00:00
|
|
|
} else {
|
2021-02-08 12:21:23 +00:00
|
|
|
chatsModel.joinChatWithENS(pk, ensName);
|
2020-11-17 14:37:00 +00:00
|
|
|
}
|
2021-03-31 19:14:40 +00:00
|
|
|
|
2020-06-15 16:24:21 +00:00
|
|
|
popup.close();
|
|
|
|
}
|
|
|
|
|
2020-05-28 12:56:43 +00:00
|
|
|
id: popup
|
2020-07-06 20:39:55 +00:00
|
|
|
//% "New chat"
|
|
|
|
title: qsTrId("new-chat")
|
2020-05-29 16:27:50 +00:00
|
|
|
|
2020-05-29 18:38:11 +00:00
|
|
|
onOpened: {
|
2021-03-31 19:14:40 +00:00
|
|
|
contactFieldAndList.chatKey.text = ""
|
|
|
|
contactFieldAndList.pubKey = ""
|
|
|
|
contactFieldAndList.ensUsername = ""
|
|
|
|
contactFieldAndList.chatKey.forceActiveFocus(Qt.MouseFocusReason)
|
|
|
|
contactFieldAndList.existingContacts.visible = profileModel.contacts.list.hasAddedContacts()
|
|
|
|
contactFieldAndList.noContactsRect.visible = !contactFieldAndList.existingContacts.visible
|
|
|
|
}
|
|
|
|
|
|
|
|
ContactsListAndSearch {
|
|
|
|
id: contactFieldAndList
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
onUserClicked: function (isContact, pubKey, ensName) {
|
|
|
|
if(Utils.isChatKey(pubKey)){
|
|
|
|
chatsModel.joinChat(pubKey, Constants.chatTypeOneToOne);
|
|
|
|
} else {
|
|
|
|
chatsModel.joinChatWithENS(pubKey, ensName);
|
2020-07-07 19:03:23 +00:00
|
|
|
}
|
2021-02-08 12:21:23 +00:00
|
|
|
|
2021-03-31 19:14:40 +00:00
|
|
|
popup.close();
|
2021-02-08 12:21:23 +00:00
|
|
|
}
|
2020-11-16 20:56:10 +00:00
|
|
|
}
|
2020-05-28 12:56:43 +00:00
|
|
|
}
|
2020-06-16 18:04:56 +00:00
|
|
|
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
|
|
|
D{i:0;height:300;width:300}
|
|
|
|
}
|
|
|
|
##^##*/
|