From ea0a7517e4838931865f5b0a375efa103a2d5310 Mon Sep 17 00:00:00 2001 From: miruka Date: Wed, 8 Jul 2020 17:33:02 -0400 Subject: [PATCH] Reload member device list after trust/blacklisting --- .../MemberView/DeviceVerification.qml | 4 +++ .../MemberView/MemberDeviceDelegate.qml | 29 ++++++++++--------- .../RoomPane/MemberView/MemberProfile.qml | 2 ++ 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/gui/Pages/Chat/RoomPane/MemberView/DeviceVerification.qml b/src/gui/Pages/Chat/RoomPane/MemberView/DeviceVerification.qml index c234d6f7..edfbeabc 100644 --- a/src/gui/Pages/Chat/RoomPane/MemberView/DeviceVerification.qml +++ b/src/gui/Pages/Chat/RoomPane/MemberView/DeviceVerification.qml @@ -17,6 +17,8 @@ HFlickableColumnPage { property string ed25519Key property HStackView stackView + signal trustSet(bool trust) + footer: ButtonLayout { ApplyButton { @@ -31,6 +33,7 @@ HFlickableColumnPage { [deviceOwner, deviceId], () => { loading = false + page.trustSet(true) stackView.pop() } ) @@ -49,6 +52,7 @@ HFlickableColumnPage { [deviceOwner, deviceId], () => { loading = false + page.trustSet(false) stackView.pop() } ) diff --git a/src/gui/Pages/Chat/RoomPane/MemberView/MemberDeviceDelegate.qml b/src/gui/Pages/Chat/RoomPane/MemberView/MemberDeviceDelegate.qml index 66e99f36..4122a8e4 100644 --- a/src/gui/Pages/Chat/RoomPane/MemberView/MemberDeviceDelegate.qml +++ b/src/gui/Pages/Chat/RoomPane/MemberView/MemberDeviceDelegate.qml @@ -15,7 +15,7 @@ HTile { property string deviceOwnerDisplayName property HStackView stackView - signal trustChanged() + signal trustSet(bool trust) backgroundColor: "transparent" @@ -49,16 +49,19 @@ HTile { } } - onClicked: stackView.push( - "DeviceVerification.qml", - { - userId: deviceTile.userId, - deviceOwner: deviceTile.deviceOwner, - deviceOwnerDisplayName: deviceTile.deviceOwnerDisplayName, - deviceId: model.id, - deviceName: model.display_name, - ed25519Key: model.ed25519_key, - stackView: deviceTile.stackView - }, - ) + onClicked: { + const item = stackView.push( + "DeviceVerification.qml", + { + userId: deviceTile.userId, + deviceOwner: deviceTile.deviceOwner, + deviceOwnerDisplayName: deviceTile.deviceOwnerDisplayName, + deviceId: model.id, + deviceName: model.display_name, + ed25519Key: model.ed25519_key, + stackView: deviceTile.stackView + }, + ) + item.trustSet.connect(deviceTile.trustSet) + } } diff --git a/src/gui/Pages/Chat/RoomPane/MemberView/MemberProfile.qml b/src/gui/Pages/Chat/RoomPane/MemberView/MemberProfile.qml index 8ca24557..d2e29d88 100644 --- a/src/gui/Pages/Chat/RoomPane/MemberView/MemberProfile.qml +++ b/src/gui/Pages/Chat/RoomPane/MemberView/MemberProfile.qml @@ -34,6 +34,8 @@ HListView { deviceOwner: member.id deviceOwnerDisplayName: member.display_name stackView: profile.stackView + + onTrustSet: trust => profile.loadDevices() } section.property: "type"