Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: No toast on removal of untrusted mark #16972

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui/app/AppLayouts/Chat/panels/UserListPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Item {
emojiHash: model.emojiHash,
colorHash: model.colorHash,
colorId: model.colorId,
displayName: nickName || userName,
displayName: model.preferredDisplayName,
userIcon: model.icon,
trustStatus: model.trustStatus,
onlineStatus: model.onlineStatus,
Expand Down
5 changes: 4 additions & 1 deletion ui/app/AppLayouts/Chat/views/ChatView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,10 @@ StatusSectionLayout {
root.rootStore.chatCommunitySectionModule.createOneToOneChat("", pubKey, "")
}

onRemoveTrustStatusRequested: root.contactsStore.removeTrustStatus(pubKey)
onRemoveTrustStatusRequested: (pubKey) => {
const preferredDisplayName = ModelUtils.getByKey(usersModel, "pubKey", pubKey, "preferredDisplayName")
root.contactsStore.removeTrustStatus(pubKey, preferredDisplayName)
}
onRemoveContactFromGroupRequested: root.rootStore.removeMemberFromGroupChat(pubKey)

onMarkAsTrustedRequested: Global.openMarkAsIDVerifiedPopup(pubKey, null)
Expand Down
2 changes: 1 addition & 1 deletion ui/app/AppLayouts/Communities/panels/MembersTabPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ Item {
onRemoveNickname: root.rootStore.contactsStore.changeContactNickname(pubKey, "", displayName, true)
onUnblockContact: Global.unblockContactRequested(pubKey)
onMarkAsUntrusted: Global.markAsUntrustedRequested(pubKey)
onRemoveTrustStatus: root.rootStore.contactsStore.removeTrustStatus(pubKey)
onRemoveTrustStatus: root.rootStore.contactsStore.removeTrustStatus(pubKey, displayName)
onRemoveContact: Global.removeContactRequested(pubKey)
onBlockContact: Global.blockContactRequested(pubKey)
onMarkAsTrusted: Global.openMarkAsIDVerifiedPopup(pubKey, null)
Expand Down
4 changes: 3 additions & 1 deletion ui/app/AppLayouts/Profile/stores/ContactsStore.qml
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,10 @@ QtObject {
d.contactsModuleInst.markUntrustworthy(pubKey)
}

function removeTrustStatus(pubKey) {
function removeTrustStatus(pubKey, displayName = "") {
d.contactsModuleInst.removeTrustStatus(pubKey)
if (!!displayName)
Global.displaySuccessToastMessage(qsTr("Untrusted mark removed for %1").arg(displayName))
}

function requestContactInfo(publicKey) {
Expand Down
2 changes: 1 addition & 1 deletion ui/app/AppLayouts/Profile/views/ContactsView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ SettingsContentBase {
onBlockContact: Global.blockContactRequested(contactContextMenu.pubKey)

onCreateOneToOneChat: root.contactsStore.joinPrivateChat(contactContextMenu.pubKey)
onRemoveTrustStatus: root.contactsStore.removeTrustStatus(contactContextMenu.pubKey)
onRemoveTrustStatus: root.contactsStore.removeTrustStatus(contactContextMenu.pubKey, contactContextMenu.displayName)
onRemoveNickname: root.contactsStore.changeContactNickname(contactContextMenu.pubKey, "",
contactContextMenu.displayName, true)
onMarkAsTrusted: Global.openMarkAsIDVerifiedPopup(contactContextMenu.pubKey, null)
Expand Down
2 changes: 1 addition & 1 deletion ui/imports/shared/views/ProfileDialogView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ Pane {
icon.name: "warning"
type: StatusAction.Type.Danger
enabled: contactDetails.trustStatus === Constants.trustStatus.untrustworthy && !d.isBlocked
onTriggered: root.contactsStore.removeTrustStatus(root.publicKey)
onTriggered: root.contactsStore.removeTrustStatus(root.publicKey, d.mainDisplayName)
}
StatusAction {
text: qsTr("Remove contact")
Expand Down
2 changes: 1 addition & 1 deletion ui/imports/shared/views/chat/MessageView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ Loader {
"", profileContextMenu.displayName, true)
onUnblockContact: Global.unblockContactRequested(profileContextMenu.pubKey)
onMarkAsUntrusted: Global.markAsUntrustedRequested(profileContextMenu.pubKey)
onRemoveTrustStatus: root.rootStore.contactsStore.removeTrustStatus(profileContextMenu.pubKey)
onRemoveTrustStatus: root.rootStore.contactsStore.removeTrustStatus(profileContextMenu.pubKey, profileContextMenu.displayName)
onRemoveContact: Global.removeContactRequested(profileContextMenu.pubKey)
onBlockContact: Global.blockContactRequested(profileContextMenu.pubKey)
onRemoveFromGroup: root.rootStore.removeMemberFromGroupChat(profileContextMenu.pubKey)
Expand Down