Add basic cross-signing support
(cherry picked from commit e1795076c8c41a34b91c31df35d1e344d0b14887)
This commit is contained in:
@@ -417,3 +417,12 @@ bool Controller::ssssSupported() const
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool Controller::csSupported() const
|
||||
{
|
||||
#if Quotient_VERSION_MINOR > 9
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -51,6 +51,7 @@ class Controller : public QObject
|
||||
Q_PROPERTY(QStringList accountsLoading MEMBER m_accountsLoading NOTIFY accountsLoadingChanged)
|
||||
|
||||
Q_PROPERTY(bool ssssSupported READ ssssSupported CONSTANT)
|
||||
Q_PROPERTY(bool csSupported READ csSupported CONSTANT)
|
||||
|
||||
public:
|
||||
static Controller &instance();
|
||||
@@ -97,6 +98,7 @@ public:
|
||||
Q_INVOKABLE void removeConnection(const QString &userId);
|
||||
|
||||
bool ssssSupported() const;
|
||||
bool csSupported() const;
|
||||
|
||||
private:
|
||||
explicit Controller(QObject *parent = nullptr);
|
||||
|
||||
@@ -72,6 +72,12 @@ QQC2.Menu {
|
||||
})
|
||||
enabled: Controller.ssssSupported
|
||||
}
|
||||
QQC2.MenuItem {
|
||||
text: i18nc("@action:inmenu", "Verify this Device")
|
||||
icon.name: "security-low"
|
||||
onTriggered: root.connection.startSelfVerification()
|
||||
enabled: Controller.csSupported
|
||||
}
|
||||
QQC2.MenuItem {
|
||||
text: i18n("Logout")
|
||||
icon.name: "list-remove-user"
|
||||
|
||||
@@ -59,12 +59,27 @@ ColumnLayout {
|
||||
}
|
||||
}
|
||||
|
||||
Kirigami.Heading {
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
type: Kirigami.Heading.Type.Primary
|
||||
wrapMode: QQC2.Label.Wrap
|
||||
text: root.room.displayName
|
||||
textFormat: Text.PlainText
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Kirigami.Icon {
|
||||
id: securityIcon
|
||||
//TODO figure out how to make this update
|
||||
source: room.connection.isUserVerified(root.room.directChatRemoteMember.id) ?
|
||||
(room.connection.allSessionsSelfVerified(root.room.directChatRemoteMember.id) ? "security-high" : "security-medium")
|
||||
: "security-low"
|
||||
|
||||
}
|
||||
Kirigami.Heading {
|
||||
type: Kirigami.Heading.Type.Primary
|
||||
wrapMode: QQC2.Label.Wrap
|
||||
text: root.room.displayName
|
||||
textFormat: Text.PlainText
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
}
|
||||
Item {
|
||||
Layout.preferredWidth: visible ? securityIcon.width : 0
|
||||
visible: securityIcon.visible
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,6 +89,16 @@ QQC2.ScrollView {
|
||||
}
|
||||
}
|
||||
|
||||
Delegates.RoundedItemDelegate {
|
||||
visible: root.room.isDirectChat() && Controller.csSupported
|
||||
icon.name: "security-low-symbolic"
|
||||
text: i18nc("@action:button", "Verify user")
|
||||
|
||||
onClicked: root.room.startVerification()
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Delegates.RoundedItemDelegate {
|
||||
id: favouriteButton
|
||||
visible: !root.room.isSpace
|
||||
|
||||
Reference in New Issue
Block a user