Some more fixes

master
CH Chethan Reddy 4 years ago
parent 4862be06be
commit fd232b1f4a
  1. 28
      resources/qml/UserProfile.qml
  2. 10
      src/DeviceVerificationFlow.cpp
  3. 1
      src/DeviceVerificationFlow.h

@ -13,7 +13,7 @@ ApplicationWindow{
id:userProfileDialog
height: 500
width: 400
width: 420
modality:Qt.WindowModal
Layout.alignment: Qt.AlignHCenter
palette: colors
@ -42,9 +42,8 @@ ApplicationWindow{
id: userProfileItem
width: userProfileDialog.width
height: userProfileDialog.height
anchors.margins: {
top:20
}
Layout.fillHeight : true
ColumnLayout{
anchors.fill: userProfileItem
@ -59,13 +58,16 @@ ApplicationWindow{
displayName: modelData.userName
userid: modelData.userId
Layout.alignment: Qt.AlignHCenter
Layout.margins : {
top: 10
}
}
Label{
id: userProfileName
text: user_data.userName
fontSizeMode: Text.HorizontalFit
font.pixelSize: 16
font.pixelSize: 20
color:TimelineManager.userColor(modelData.userId, colors.window)
font.bold: true
Layout.alignment: Qt.AlignHCenter
@ -75,7 +77,7 @@ ApplicationWindow{
id: matrixUserID
text: user_data.userId
fontSizeMode: Text.HorizontalFit
font.pixelSize: 16
font.pixelSize: 15
color:colors.text
Layout.alignment: Qt.AlignHCenter
}
@ -90,7 +92,7 @@ ApplicationWindow{
id: deviceList
anchors.fill: parent
clip: true
spacing: 10
spacing: 4
model: UserProfileModel{
id: modelDeviceList
@ -98,6 +100,9 @@ ApplicationWindow{
delegate: RowLayout{
width: parent.width
Layout.margins : {
top : 50
}
ColumnLayout{
Text{
Layout.fillWidth: true
@ -124,6 +129,9 @@ ApplicationWindow{
{flow: newFlow});
dialog.show();
}
Layout.margins:{
right: 10
}
palette {
button: "white"
}
@ -142,12 +150,8 @@ ApplicationWindow{
id: okbutton
text:"OK"
onClicked: userProfileDialog.close()
anchors {
right: parent.right
bottom: parent.bottom
}
anchors.margins : {
Layout.margins : {
right : 10
bottom : 10
}

@ -164,7 +164,10 @@ DeviceVerificationFlow::DeviceVerificationFlow(QObject *)
// uncomment this in future to be compatible with the
// MSC2366 this->sendVerificationDone(); and remoeve the
// below line
if (this->isMacVerified == true)
emit this->deviceVerified();
else
this->isMacVerified = true;
} else {
this->cancelVerification();
}
@ -503,11 +506,16 @@ DeviceVerificationFlow::sendVerificationMac()
http::client()
->send_to_device<mtx::events::msg::KeyVerificationMac,
mtx::events::EventType::KeyVerificationMac>(
this->transaction_id, body, [](mtx::http::RequestErr err) {
this->transaction_id, body, [this](mtx::http::RequestErr err) {
if (err)
nhlog::net()->warn("failed to send verification MAC: {} {}",
err->matrix_error.error,
static_cast<int>(err->status_code));
if (this->isMacVerified == true)
emit this->deviceVerified();
else
this->isMacVerified = true;
});
}
//! Completes the verification flow

@ -78,6 +78,7 @@ private:
QTimer *timeout = nullptr;
sas_ptr sas;
bool isMacVerified;
std::string mac_method;
std::string transaction_id;
std::string commitment;

Loading…
Cancel
Save