Suggest verifying your own device in Devices settings
This button is currently hidden under the user menu, but it should be shown more prominently - especially under the Devices settings. The button under the user menu and this new one is now hidden when your device is already verified.
This commit is contained in:
@@ -88,9 +88,10 @@ KirigamiComponents.ConvergentContextMenu {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
QQC2.Action {
|
Kirigami.Action {
|
||||||
text: i18nc("@action:inmenu", "Verify This Device")
|
text: i18nc("@action:inmenu", "Verify This Device")
|
||||||
icon.name: "security-low"
|
icon.name: "security-low"
|
||||||
|
visible: !root.connection.isVerifiedSession()
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
root.connection.startSelfVerification();
|
root.connection.startSelfVerification();
|
||||||
const dialog = Qt.createComponent("org.kde.kirigami", "PromptDialog").createObject(QQC2.Overlay.overlay, {
|
const dialog = Qt.createComponent("org.kde.kirigami", "PromptDialog").createObject(QQC2.Overlay.overlay, {
|
||||||
|
|||||||
@@ -558,4 +558,9 @@ bool NeoChatConnection::enablePushNotifications() const
|
|||||||
return m_pushNotificationsEnabled;
|
return m_pushNotificationsEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool NeoChatConnection::isVerifiedSession() const
|
||||||
|
{
|
||||||
|
return isVerifiedDevice(userId(), deviceId());
|
||||||
|
}
|
||||||
|
|
||||||
#include "moc_neochatconnection.cpp"
|
#include "moc_neochatconnection.cpp"
|
||||||
|
|||||||
@@ -206,6 +206,11 @@ public:
|
|||||||
|
|
||||||
LinkPreviewer *previewerForLink(const QUrl &link);
|
LinkPreviewer *previewerForLink(const QUrl &link);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return True if this connection is a verified session.
|
||||||
|
*/
|
||||||
|
Q_INVOKABLE bool isVerifiedSession() const;
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void globalUrlPreviewEnabledChanged();
|
void globalUrlPreviewEnabledChanged();
|
||||||
void labelChanged();
|
void labelChanged();
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import org.kde.neochat
|
|||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
default property alias delegates: devicesCard.delegates
|
||||||
required property string title
|
required property string title
|
||||||
required property var type
|
required property var type
|
||||||
required property bool showVerifyButton
|
required property bool showVerifyButton
|
||||||
|
|||||||
@@ -33,6 +33,25 @@ FormCard.FormCardPage {
|
|||||||
title: i18nc("@info:group", "This Device")
|
title: i18nc("@info:group", "This Device")
|
||||||
type: DevicesModel.This
|
type: DevicesModel.This
|
||||||
showVerifyButton: false
|
showVerifyButton: false
|
||||||
|
|
||||||
|
FormCard.FormButtonDelegate {
|
||||||
|
icon.name: "security-low"
|
||||||
|
text: i18nc("@action:button", "Verify This Device")
|
||||||
|
description: i18nc("@info:description", "This device is marked as insecure until it's verified by another device. It's recommended to verify as soon as possible.")
|
||||||
|
visible: !root.connection.isVerifiedSession()
|
||||||
|
onClicked: {
|
||||||
|
root.connection.startSelfVerification();
|
||||||
|
const dialog = Qt.createComponent("org.kde.kirigami", "PromptDialog").createObject(QQC2.Overlay.overlay, {
|
||||||
|
title: i18nc("@title", "Verification Request Sent"),
|
||||||
|
subtitle: i18nc("@info:label", "To proceed, accept the verification request on another device."),
|
||||||
|
standardButtons: Kirigami.Dialog.Ok
|
||||||
|
})
|
||||||
|
dialog.open();
|
||||||
|
root.connection.onNewKeyVerificationSession.connect(() => {
|
||||||
|
dialog.close();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
DevicesCard {
|
DevicesCard {
|
||||||
title: i18nc("@info:group", "Verified Devices")
|
title: i18nc("@info:group", "Verified Devices")
|
||||||
|
|||||||
Reference in New Issue
Block a user