Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding device verification to user profile #203

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
2e0afde
First design iteration of device verification dialogs
deepbluev7 Mar 8, 2020
b6997db
Add DeviceVerificationFlow dummy and verification test button
deepbluev7 Mar 13, 2020
01a7e0c
Set proper emoji font for device verification
deepbluev7 Mar 14, 2020
b3495bd
Make emojis a bit smaller
deepbluev7 Mar 20, 2020
42a7ac2
Use label in device verification dialogs (for proper theming)
deepbluev7 Mar 30, 2020
689894f
Add DeviceVerificationFlow dummy and verification test button
deepbluev7 Mar 13, 2020
07823f8
Rewrite UserProfile in qml
Chethan2k1 May 17, 2020
2d23353
Adding DeviceList for userprofile
Chethan2k1 May 22, 2020
a4d9cc4
Add C++ Model for DeviceList
Chethan2k1 May 27, 2020
24f59ae
Tweak UI for device verification and Add more slots
Chethan2k1 Jun 4, 2020
0035cc6
Add SAS Method choice and Add send_to_device API call
Chethan2k1 Jun 7, 2020
bbaf15b
Handle Device Verification related to_device messages
Chethan2k1 Jun 9, 2020
8da77bc
Add DeviceVerificationList to keep track of all flows and Popup on
Chethan2k1 Jun 17, 2020
30aaf8c
Shared secret with decimal and emoji works!
Chethan2k1 Jun 20, 2020
33c13ee
Add some more slots and mac
Chethan2k1 Jun 22, 2020
0d8bbfe
Some Improvements
Chethan2k1 Jun 23, 2020
7cc2df9
Some more changes
Chethan2k1 Jun 24, 2020
ff1176e
Fix presence indicator
deepbluev7 Jun 24, 2020
26874eb
Some more fixes
Chethan2k1 Jun 25, 2020
303ceb9
Fix the Weird auto-confirmation and cancellation
Chethan2k1 Jun 25, 2020
2edbf57
Add some Userprofile buttons
Chethan2k1 Jun 25, 2020
2f1d026
Error Handling and some fixes
Chethan2k1 Jun 26, 2020
362ab16
[WIP] Add Caching for users
Chethan2k1 Jun 28, 2020
9e3f900
Some issue with UserProfile
Chethan2k1 Jul 1, 2020
c7e1600
Refactor UserProfile
deepbluev7 Jul 4, 2020
fcbff88
Adding icons to UserProfile
Chethan2k1 Jul 5, 2020
eb80360
Updating keys of outdated encrypted users
Chethan2k1 Jul 6, 2020
ce2acbd
Adding Room Key Verification Stuff
Chethan2k1 Jul 17, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions resources/qml/TimelineView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ Page {
flow.sender = false;
flow.deviceId = deviceId;
flow.tranId = transactionId;
deviceVerificationList.add(flow.tranId);
var dialog = deviceVerificationDialog.createObject(timelineRoot,
{flow: flow,sender: false});
Chethan2k1 marked this conversation as resolved.
Show resolved Hide resolved
dialog.show();
Expand Down
26 changes: 15 additions & 11 deletions resources/qml/device-verification/DeviceVerification.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ ApplicationWindow {
implicitHeight: currentItem.implicitHeight
}

onClosing: stack.replace(newVerificationRequest)
onClosing: {
flow.cancelVerification();
deviceVerificationList.remove(flow.tranId);
delete flow;
}

property var flow
Connections {
Expand Down Expand Up @@ -78,7 +82,7 @@ ApplicationWindow {
onClicked: {
dialog.close();
flow.cancelVerification();
// deviceVerificationList.remove(flow.tranId);
deviceVerificationList.remove(flow.tranId);
delete flow;
}
}
Expand Down Expand Up @@ -135,7 +139,7 @@ ApplicationWindow {
onClicked: {
dialog.close();
flow.cancelVerification();
// deviceVerificationList.remove(flow.tranId);
deviceVerificationList.remove(flow.tranId);
delete flow;
}
}
Expand Down Expand Up @@ -179,7 +183,7 @@ ApplicationWindow {
onClicked: {
dialog.close();
flow.cancelVerification();
// deviceVerificationList.remove(flow.tranId);
deviceVerificationList.remove(flow.tranId);
delete flow;
}
}
Expand Down Expand Up @@ -230,7 +234,7 @@ ApplicationWindow {
onClicked: {
dialog.close();
flow.cancelVerification();
// deviceVerificationList.remove(flow.tranId);
deviceVerificationList.remove(flow.tranId);
delete flow;
}
}
Expand Down Expand Up @@ -369,7 +373,7 @@ ApplicationWindow {
onClicked: {
dialog.close();
flow.cancelVerification();
// deviceVerificationList.remove(flow.tranId);
deviceVerificationList.remove(flow.tranId);
delete flow;
}
}
Expand Down Expand Up @@ -413,7 +417,7 @@ ApplicationWindow {
onClicked: {
dialog.close();
flow.cancelVerification();
// deviceVerificationList.remove(flow.tranId);
deviceVerificationList.remove(flow.tranId);
delete flow;
}
}
Expand Down Expand Up @@ -451,7 +455,7 @@ ApplicationWindow {
text: "Close"
onClicked: {
dialog.close()
// deviceVerificationList.remove(flow.tranId);
deviceVerificationList.remove(flow.tranId);
delete flow;
}
}
Expand Down Expand Up @@ -485,8 +489,8 @@ ApplicationWindow {
Layout.alignment: Qt.AlignRight
text: "Close"
onClicked: {
dialog.close()
// deviceVerificationList.remove(flow.tranId);
dialog.close();
deviceVerificationList.remove(flow.tranId);
delete flow;
}
}
Expand Down Expand Up @@ -521,7 +525,7 @@ ApplicationWindow {
text: "Close"
onClicked: {
dialog.close()
// deviceVerificationList.remove(flow.tranId);
deviceVerificationList.remove(flow.tranId);
delete flow;
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/DeviceVerificationFlow.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "DeviceVerificationFlow.h"
#include "ChatPage.h"
#include "Logging.h"
#include "Utils.h"

#include <QDateTime>
#include <QTimer>
Expand Down Expand Up @@ -162,7 +161,10 @@ DeviceVerificationFlow::DeviceVerificationFlow(QObject *)
}
if (msg.content.keys ==
this->sas->calculate_mac(key_string, info + "KEY_IDS")) {
this->sendVerificationDone();
// uncomment this in future to be compatible with the
// MSC2366 this->sendVerificationDone(); and remoeve the
// below line
emit this->deviceVerified();
} else {
this->cancelVerification();
}
Expand Down
17 changes: 4 additions & 13 deletions src/timeline/TimelineViewManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,17 @@ namespace msgs = mtx::events::msg;
void
DeviceVerificationList::add(QString tran_id)
{
this->dv_list.push_back(tran_id);
this->dv_list.append(tran_id);
}
void
DeviceVerificationList::remove(QString tran_id)
{
for (QVector<QString>::iterator it = 0; it != (this->dv_list).end(); ++it) {
if (*it == tran_id) {
this->dv_list.erase(it);
break;
}
}
this->dv_list.removeOne(tran_id);
}
bool
DeviceVerificationList::exist(QString tran_id)
{
for (int i = 0; i < (this->dv_list).size(); ++i) {
if (dv_list[i] == tran_id)
return true;
}
return false;
return this->dv_list.contains(tran_id);
}

void
Expand Down Expand Up @@ -179,7 +170,7 @@ TimelineViewManager::TimelineViewManager(QSharedPointer<UserSettings> userSettin
msg.content.methods.end(),
mtx::events::msg::VerificationMethods::SASv1) !=
msg.content.methods.end()) {
flow->sendVerificationReady();
// flow->sendVerificationReady();
emit newDeviceVerificationRequest(
std::move(flow),
QString::fromStdString(msg.content.transaction_id),
Expand Down
3 changes: 2 additions & 1 deletion src/timeline/TimelineViewManager.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <QHash>
#include <QLinkedList>
#include <QQuickView>
#include <QQuickWidget>
#include <QSharedPointer>
Expand Down Expand Up @@ -31,7 +32,7 @@ class DeviceVerificationList : public QObject
Q_INVOKABLE bool exist(QString tran_id);

private:
QVector<QString> dv_list;
QLinkedList<QString> dv_list;
Chethan2k1 marked this conversation as resolved.
Show resolved Hide resolved
};

class TimelineViewManager : public QObject
Expand Down