summary refs log tree commit diff
path: root/resources/qml
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-05-07 12:19:46 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-05-07 17:01:57 +0200
commit0d0709ccd37ef2f689c9d22a20994ce8d423e18b (patch)
tree110a1e0692184d34a3535dce1f8d3d99c1d70194 /resources/qml
parentTranslated using Weblate (Spanish) (diff)
downloadnheko-0d0709ccd37ef2f689c9d22a20994ce8d423e18b.tar.xz
Show verification status next to messages
Diffstat (limited to 'resources/qml')
-rw-r--r--resources/qml/EncryptionIndicator.qml29
-rw-r--r--resources/qml/TimelineRow.qml1
-rw-r--r--resources/qml/UserProfile.qml8
3 files changed, 30 insertions, 8 deletions
diff --git a/resources/qml/EncryptionIndicator.qml b/resources/qml/EncryptionIndicator.qml
index 58805f48..1e5d4d38 100644
--- a/resources/qml/EncryptionIndicator.qml
+++ b/resources/qml/EncryptionIndicator.qml
@@ -10,17 +10,38 @@ Image {
     id: stateImg
 
     property bool encrypted: false
+    property int trust: Crypto.Unverified
 
     width: 16
     height: 16
     source: {
-        if (encrypted)
-            return "image://colorimage/:/icons/icons/ui/lock.png?" + colors.buttonText;
-        else
+        if (encrypted) {
+            switch (trust) {
+            case Crypto.Verified:
+                return "image://colorimage/:/icons/icons/ui/lock.png?green";
+            case Crypto.TOFU:
+                return "image://colorimage/:/icons/icons/ui/lock.png?" + colors.buttonText;
+            default:
+                return "image://colorimage/:/icons/icons/ui/lock.png?#dd3d3d";
+            }
+        } else {
             return "image://colorimage/:/icons/icons/ui/unlock.png?#dd3d3d";
+        }
     }
     ToolTip.visible: ma.hovered
-    ToolTip.text: encrypted ? qsTr("Encrypted") : qsTr("This message is not encrypted!")
+    ToolTip.text: {
+        if (!encrypted)
+            return qsTr("This message is not encrypted!");
+
+        switch (trust) {
+        case Crypto.Verified:
+            return qsTr("Encrypted by a verified device");
+        case Crypto.TOFU:
+            return qsTr("Encrypted by an unverified device, but you have trusted that user so far.");
+        default:
+            return qsTr("Encrypted by an unverified device");
+        }
+    }
 
     HoverHandler {
         id: ma
diff --git a/resources/qml/TimelineRow.qml b/resources/qml/TimelineRow.qml
index 715e8bd1..09a55e60 100644
--- a/resources/qml/TimelineRow.qml
+++ b/resources/qml/TimelineRow.qml
@@ -86,6 +86,7 @@ Item {
         EncryptionIndicator {
             visible: model.isRoomEncrypted
             encrypted: model.isEncrypted
+            trust: model.trustlevel
             Layout.alignment: Qt.AlignRight | Qt.AlignTop
             Layout.preferredHeight: 16
             Layout.preferredWidth: 16
diff --git a/resources/qml/UserProfile.qml b/resources/qml/UserProfile.qml
index bd25b74e..21c44793 100644
--- a/resources/qml/UserProfile.qml
+++ b/resources/qml/UserProfile.qml
@@ -137,16 +137,16 @@ ApplicationWindow {
 
             text: qsTr("Verify")
             Layout.alignment: Qt.AlignHCenter
-            enabled: !profile.isUserVerified
-            visible: !profile.isUserVerified && !profile.isSelf && profile.userVerificationEnabled
+            enabled: profile.userVerified != Crypto.Verified
+            visible: profile.userVerified != Crypto.Verified && !profile.isSelf && profile.userVerificationEnabled
             onClicked: profile.verify()
         }
 
         Image {
             Layout.preferredHeight: 16
             Layout.preferredWidth: 16
-            source: "image://colorimage/:/icons/icons/ui/lock.png?green"
-            visible: profile.isUserVerified
+	    source: "image://colorimage/:/icons/icons/ui/lock.png?" + ((profile.userVerified == Crypto.Verified) ?  "green" : colors.buttonText)
+            visible: profile.userVerified != Crypto.Unverified
             Layout.alignment: Qt.AlignHCenter
         }