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 QtQml 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
|
||||
import StatusQ.Core.Theme 0.1
|
||||
import StatusQ.Core.Utils 0.1 as StatusQUtils
|
||||
@ -124,7 +125,7 @@ ColumnLayout {
|
||||
sourceComponent: MessageContextMenuView {
|
||||
store: root.rootStore
|
||||
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: {
|
||||
messageStore.pinMessage(messageId)
|
||||
@ -248,7 +249,7 @@ ColumnLayout {
|
||||
anchors.margins: Style.current.smallPadding
|
||||
|
||||
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
|
||||
usersStore: root.usersStore
|
||||
|
@ -253,7 +253,7 @@ Item {
|
||||
chatLogView: ListView.view
|
||||
|
||||
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
|
||||
|
||||
messageId: model.id
|
||||
@ -339,7 +339,7 @@ Item {
|
||||
case Constants.ContactRequestState.Dismissed:
|
||||
return sendContactRequestComponent
|
||||
case Constants.ContactRequestState.Received:
|
||||
return acceptContactRequestComponent
|
||||
return acceptOrDeclineContactRequestComponent
|
||||
case Constants.ContactRequestState.Sent:
|
||||
return pendingContactRequestComponent
|
||||
default:
|
||||
@ -371,13 +371,24 @@ Item {
|
||||
}
|
||||
|
||||
Component {
|
||||
id: acceptContactRequestComponent
|
||||
id: acceptOrDeclineContactRequestComponent
|
||||
|
||||
StatusButton {
|
||||
RowLayout {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: qsTr("Accept Contact Request")
|
||||
onClicked: {
|
||||
root.contactsStore.acceptContactRequest(root.publicKey, "")
|
||||
|
||||
StatusButton {
|
||||
text: qsTr("Reject Contact Request")
|
||||
type: StatusBaseButton.Type.Danger
|
||||
onClicked: {
|
||||
root.contactsStore.dismissContactRequest(root.publicKey, "")
|
||||
}
|
||||
}
|
||||
|
||||
StatusButton {
|
||||
text: qsTr("Accept Contact Request")
|
||||
onClicked: {
|
||||
root.contactsStore.acceptContactRequest(root.publicKey, "")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user