mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-26 13:08:48 +03:00
Some more fixes
This commit is contained in:
parent
4862be06be
commit
fd232b1f4a
3 changed files with 28 additions and 15 deletions
|
@ -13,7 +13,7 @@ ApplicationWindow{
|
||||||
|
|
||||||
id:userProfileDialog
|
id:userProfileDialog
|
||||||
height: 500
|
height: 500
|
||||||
width: 400
|
width: 420
|
||||||
modality:Qt.WindowModal
|
modality:Qt.WindowModal
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
palette: colors
|
palette: colors
|
||||||
|
@ -42,9 +42,8 @@ ApplicationWindow{
|
||||||
id: userProfileItem
|
id: userProfileItem
|
||||||
width: userProfileDialog.width
|
width: userProfileDialog.width
|
||||||
height: userProfileDialog.height
|
height: userProfileDialog.height
|
||||||
anchors.margins: {
|
|
||||||
top:20
|
Layout.fillHeight : true
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout{
|
ColumnLayout{
|
||||||
anchors.fill: userProfileItem
|
anchors.fill: userProfileItem
|
||||||
|
@ -57,15 +56,18 @@ ApplicationWindow{
|
||||||
height: 130
|
height: 130
|
||||||
width: 130
|
width: 130
|
||||||
displayName: modelData.userName
|
displayName: modelData.userName
|
||||||
userid: modelData.userId
|
userid: modelData.userId
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
Layout.margins : {
|
||||||
|
top: 10
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Label{
|
Label{
|
||||||
id: userProfileName
|
id: userProfileName
|
||||||
text: user_data.userName
|
text: user_data.userName
|
||||||
fontSizeMode: Text.HorizontalFit
|
fontSizeMode: Text.HorizontalFit
|
||||||
font.pixelSize: 16
|
font.pixelSize: 20
|
||||||
color:TimelineManager.userColor(modelData.userId, colors.window)
|
color:TimelineManager.userColor(modelData.userId, colors.window)
|
||||||
font.bold: true
|
font.bold: true
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
@ -75,7 +77,7 @@ ApplicationWindow{
|
||||||
id: matrixUserID
|
id: matrixUserID
|
||||||
text: user_data.userId
|
text: user_data.userId
|
||||||
fontSizeMode: Text.HorizontalFit
|
fontSizeMode: Text.HorizontalFit
|
||||||
font.pixelSize: 16
|
font.pixelSize: 15
|
||||||
color:colors.text
|
color:colors.text
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
}
|
}
|
||||||
|
@ -90,7 +92,7 @@ ApplicationWindow{
|
||||||
id: deviceList
|
id: deviceList
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
clip: true
|
clip: true
|
||||||
spacing: 10
|
spacing: 4
|
||||||
|
|
||||||
model: UserProfileModel{
|
model: UserProfileModel{
|
||||||
id: modelDeviceList
|
id: modelDeviceList
|
||||||
|
@ -98,6 +100,9 @@ ApplicationWindow{
|
||||||
|
|
||||||
delegate: RowLayout{
|
delegate: RowLayout{
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
Layout.margins : {
|
||||||
|
top : 50
|
||||||
|
}
|
||||||
ColumnLayout{
|
ColumnLayout{
|
||||||
Text{
|
Text{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
@ -124,6 +129,9 @@ ApplicationWindow{
|
||||||
{flow: newFlow});
|
{flow: newFlow});
|
||||||
dialog.show();
|
dialog.show();
|
||||||
}
|
}
|
||||||
|
Layout.margins:{
|
||||||
|
right: 10
|
||||||
|
}
|
||||||
palette {
|
palette {
|
||||||
button: "white"
|
button: "white"
|
||||||
}
|
}
|
||||||
|
@ -142,12 +150,8 @@ ApplicationWindow{
|
||||||
id: okbutton
|
id: okbutton
|
||||||
text:"OK"
|
text:"OK"
|
||||||
onClicked: userProfileDialog.close()
|
onClicked: userProfileDialog.close()
|
||||||
anchors {
|
|
||||||
right: parent.right
|
|
||||||
bottom: parent.bottom
|
|
||||||
}
|
|
||||||
|
|
||||||
anchors.margins : {
|
Layout.margins : {
|
||||||
right : 10
|
right : 10
|
||||||
bottom : 10
|
bottom : 10
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,7 +164,10 @@ DeviceVerificationFlow::DeviceVerificationFlow(QObject *)
|
||||||
// uncomment this in future to be compatible with the
|
// uncomment this in future to be compatible with the
|
||||||
// MSC2366 this->sendVerificationDone(); and remoeve the
|
// MSC2366 this->sendVerificationDone(); and remoeve the
|
||||||
// below line
|
// below line
|
||||||
emit this->deviceVerified();
|
if (this->isMacVerified == true)
|
||||||
|
emit this->deviceVerified();
|
||||||
|
else
|
||||||
|
this->isMacVerified = true;
|
||||||
} else {
|
} else {
|
||||||
this->cancelVerification();
|
this->cancelVerification();
|
||||||
}
|
}
|
||||||
|
@ -503,11 +506,16 @@ DeviceVerificationFlow::sendVerificationMac()
|
||||||
http::client()
|
http::client()
|
||||||
->send_to_device<mtx::events::msg::KeyVerificationMac,
|
->send_to_device<mtx::events::msg::KeyVerificationMac,
|
||||||
mtx::events::EventType::KeyVerificationMac>(
|
mtx::events::EventType::KeyVerificationMac>(
|
||||||
this->transaction_id, body, [](mtx::http::RequestErr err) {
|
this->transaction_id, body, [this](mtx::http::RequestErr err) {
|
||||||
if (err)
|
if (err)
|
||||||
nhlog::net()->warn("failed to send verification MAC: {} {}",
|
nhlog::net()->warn("failed to send verification MAC: {} {}",
|
||||||
err->matrix_error.error,
|
err->matrix_error.error,
|
||||||
static_cast<int>(err->status_code));
|
static_cast<int>(err->status_code));
|
||||||
|
|
||||||
|
if (this->isMacVerified == true)
|
||||||
|
emit this->deviceVerified();
|
||||||
|
else
|
||||||
|
this->isMacVerified = true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//! Completes the verification flow
|
//! Completes the verification flow
|
||||||
|
|
|
@ -78,6 +78,7 @@ private:
|
||||||
|
|
||||||
QTimer *timeout = nullptr;
|
QTimer *timeout = nullptr;
|
||||||
sas_ptr sas;
|
sas_ptr sas;
|
||||||
|
bool isMacVerified;
|
||||||
std::string mac_method;
|
std::string mac_method;
|
||||||
std::string transaction_id;
|
std::string transaction_id;
|
||||||
std::string commitment;
|
std::string commitment;
|
||||||
|
|
Loading…
Reference in a new issue