Prompt user when there are unverified devices
3 files changed, 88 insertions, 1 deletions
diff --git a/resources/qml/RoomList.qml b/resources/qml/RoomList.qml
index 85087bc4..72ac49e1 100644
--- a/resources/qml/RoomList.qml
+++ b/resources/qml/RoomList.qml
@@ -502,6 +502,86 @@ Page {
Layout.fillWidth: true
}
+ Rectangle {
+ id: unverifiedStuffBubble
+ color: Qt.lighter(Nheko.theme.orange, verifyButtonHovered.hovered ? 1.2 : 1.0)
+ Layout.fillWidth: true
+ implicitHeight: explanation.height + Nheko.paddingMedium * 2
+ visible: SelfVerificationStatus.status != SelfVerificationStatus.AllVerified
+
+ RowLayout {
+ id: unverifiedStuffBubbleContainer
+ width: parent.width
+ height: explanation.height + Nheko.paddingMedium * 2
+ spacing: 0
+
+ Label {
+ id: explanation
+ Layout.margins: Nheko.paddingMedium
+ Layout.rightMargin: Nheko.paddingSmall
+ color: Nheko.colors.buttonText
+ Layout.fillWidth: true
+ text: switch(SelfVerificationStatus.status) {
+ case SelfVerificationStatus.NoMasterKey:
+ //: Cross-signing setup has not run yet.
+ return qsTr("Encryption not set up");
+ case SelfVerificationStatus.UnverifiedMasterKey:
+ //: The user just signed in with this device and hasn't verified their master key.
+ return qsTr("Unverified login");
+ case SelfVerificationStatus.UnverifiedDevices:
+ //: There are unverified devices signed in to this account.
+ return qsTr("Please verify your other devices");
+ default:
+ return ""
+ }
+ textFormat: Text.PlainText
+ wrapMode: Text.Wrap
+ }
+
+ ImageButton {
+ id: closeUnverifiedBubble
+
+ Layout.rightMargin: Nheko.paddingMedium
+ Layout.topMargin: Nheko.paddingMedium
+ Layout.alignment: Qt.AlignRight | Qt.AlignTop
+ hoverEnabled: true
+ width: fontMetrics.font.pixelSize
+ height: fontMetrics.font.pixelSize
+ image: ":/icons/icons/ui/remove-symbol.png"
+ ToolTip.visible: closeUnverifiedBubble.hovered
+ ToolTip.text: qsTr("Close")
+ onClicked: unverifiedStuffBubble.visible = false
+ }
+
+ }
+
+ HoverHandler {
+ id: verifyButtonHovered
+ enabled: !closeUnverifiedBubble.hovered
+
+ acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus | PointerDevice.TouchPad
+ }
+
+ TapHandler {
+ enabled: !closeUnverifiedBubble.hovered
+ acceptedButtons: Qt.LeftButton
+ onSingleTapped: {
+ if (SelfVerificationStatus.status == SelfVerificationStatus.UnverifiedDevices) {
+ SelfVerificationStatus.verifyUnverifiedDevices();
+ } else {
+ SelfVerificationStatus.statusChanged();
+ }
+ }
+ }
+ }
+
+ Rectangle {
+ color: Nheko.theme.separator
+ height: 1
+ Layout.fillWidth: true
+ visible: unverifiedStuffBubble.visible
+ }
+
}
footer: ColumnLayout {
diff --git a/resources/qml/SelfVerificationCheck.qml b/resources/qml/SelfVerificationCheck.qml
index 26af82b3..a7502d8d 100644
--- a/resources/qml/SelfVerificationCheck.qml
+++ b/resources/qml/SelfVerificationCheck.qml
@@ -277,6 +277,10 @@ Item {
bootstrapCrosssigning.open();
else if (SelfVerificationStatus.status == SelfVerificationStatus.UnverifiedMasterKey)
verifyMasterKey.open();
+ else {
+ bootstrapCrosssigning.close();
+ verifyMasterKey.close();
+ }
}
diff --git a/resources/qml/device-verification/NewVerificationRequest.qml b/resources/qml/device-verification/NewVerificationRequest.qml
index 5ae2d25b..7e521605 100644
--- a/resources/qml/device-verification/NewVerificationRequest.qml
+++ b/resources/qml/device-verification/NewVerificationRequest.qml
@@ -23,7 +23,10 @@ Pane {
text: {
if (flow.sender) {
if (flow.isSelfVerification)
- return qsTr("To allow other users to see, which of your devices actually belong to you, you can verify them. This also allows key backup to work automatically. Verify %1 now?").arg(flow.deviceId);
+ if (flow.isMultiDeviceVerification)
+ return qsTr("To allow other users to see, which of your devices actually belong to you, you can verify them. This also allows key backup to work automatically. Verify an unverified device now? (Please make sure you have one of those devices available.)");
+ else
+ return qsTr("To allow other users to see, which of your devices actually belong to you, you can verify them. This also allows key backup to work automatically. Verify %1 now?").arg(flow.deviceId);
else
return qsTr("To ensure that no malicious user can eavesdrop on your encrypted communications you can verify the other party.");
} else {
|