mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-22 20:40:18 +00:00
feat(Chat): Accept/Reject CR buttons for 1-to-1 chat
This commit is contained in:
parent
6ba6a5fcde
commit
7b31929f85
@ -1,6 +1,7 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick 2.15
|
||||||
import QtQml 2.15
|
import QtQml 2.15
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls 2.15
|
||||||
|
import QtQuick.Layouts 1.15
|
||||||
|
|
||||||
import StatusQ.Core.Theme 0.1
|
import StatusQ.Core.Theme 0.1
|
||||||
import StatusQ.Core.Utils 0.1 as StatusQUtils
|
import StatusQ.Core.Utils 0.1 as StatusQUtils
|
||||||
@ -124,7 +125,7 @@ ColumnLayout {
|
|||||||
sourceComponent: MessageContextMenuView {
|
sourceComponent: MessageContextMenuView {
|
||||||
store: root.rootStore
|
store: root.rootStore
|
||||||
reactionModel: root.rootStore.emojiReactionsModel
|
reactionModel: root.rootStore.emojiReactionsModel
|
||||||
disabledForChat: chatType === Constants.chatType.oneToOne && d.contactRequestState !== Constants.ContactRequestState.Mutual
|
disabledForChat: root.chatType === Constants.chatType.oneToOne && root.contactRequestState !== Constants.ContactRequestState.Mutual
|
||||||
|
|
||||||
onPinMessage: {
|
onPinMessage: {
|
||||||
messageStore.pinMessage(messageId)
|
messageStore.pinMessage(messageId)
|
||||||
@ -248,7 +249,7 @@ ColumnLayout {
|
|||||||
anchors.margins: Style.current.smallPadding
|
anchors.margins: Style.current.smallPadding
|
||||||
|
|
||||||
enabled: root.rootStore.sectionDetails.joined && !root.rootStore.sectionDetails.amIBanned &&
|
enabled: root.rootStore.sectionDetails.joined && !root.rootStore.sectionDetails.amIBanned &&
|
||||||
!(chatType === Constants.chatType.oneToOne && d.contactRequestState !== Constants.ContactRequestState.Mutual)
|
!(chatType === Constants.chatType.oneToOne && root.contactRequestState !== Constants.ContactRequestState.Mutual)
|
||||||
|
|
||||||
store: root.rootStore
|
store: root.rootStore
|
||||||
usersStore: root.usersStore
|
usersStore: root.usersStore
|
||||||
|
@ -253,7 +253,7 @@ Item {
|
|||||||
chatLogView: ListView.view
|
chatLogView: ListView.view
|
||||||
|
|
||||||
isActiveChannel: root.isActiveChannel
|
isActiveChannel: root.isActiveChannel
|
||||||
isChatBlocked: root.isChatBlocked || (root.isOneToOne && d.contactRequestState !== Constants.ContactRequestState.Mutual)
|
isChatBlocked: root.isChatBlocked || (root.isOneToOne && root.contactRequestState !== Constants.ContactRequestState.Mutual)
|
||||||
messageContextMenu: root.messageContextMenu
|
messageContextMenu: root.messageContextMenu
|
||||||
|
|
||||||
messageId: model.id
|
messageId: model.id
|
||||||
@ -339,7 +339,7 @@ Item {
|
|||||||
case Constants.ContactRequestState.Dismissed:
|
case Constants.ContactRequestState.Dismissed:
|
||||||
return sendContactRequestComponent
|
return sendContactRequestComponent
|
||||||
case Constants.ContactRequestState.Received:
|
case Constants.ContactRequestState.Received:
|
||||||
return acceptContactRequestComponent
|
return acceptOrDeclineContactRequestComponent
|
||||||
case Constants.ContactRequestState.Sent:
|
case Constants.ContactRequestState.Sent:
|
||||||
return pendingContactRequestComponent
|
return pendingContactRequestComponent
|
||||||
default:
|
default:
|
||||||
@ -371,16 +371,27 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: acceptContactRequestComponent
|
id: acceptOrDeclineContactRequestComponent
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
|
StatusButton {
|
||||||
|
text: qsTr("Reject Contact Request")
|
||||||
|
type: StatusBaseButton.Type.Danger
|
||||||
|
onClicked: {
|
||||||
|
root.contactsStore.dismissContactRequest(root.publicKey, "")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
StatusButton {
|
StatusButton {
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
text: qsTr("Accept Contact Request")
|
text: qsTr("Accept Contact Request")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
root.contactsStore.acceptContactRequest(root.publicKey, "")
|
root.contactsStore.acceptContactRequest(root.publicKey, "")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: pendingContactRequestComponent
|
id: pendingContactRequestComponent
|
||||||
|
Loading…
x
Reference in New Issue
Block a user