summary refs log tree commit diff
path: root/src/encryption/DeviceVerificationFlow.cpp
diff options
context:
space:
mode:
authorLoren Burkholder <55629213+LorenDB@users.noreply.github.com>2022-10-03 17:57:30 -0400
committerGitHub <noreply@github.com>2022-10-03 21:57:30 +0000
commit8ecbb39dc6303fcf3ae36ad033d7e90ea29b9003 (patch)
treeccbf44824e2a038254ce77ae3890d2d6d86b0a94 /src/encryption/DeviceVerificationFlow.cpp
parentMerge pull request #1202 from Nheko-Reborn/grammar (diff)
downloadnheko-8ecbb39dc6303fcf3ae36ad033d7e90ea29b9003.tar.xz
cppcheck stuff (#1200)
* cppcheck stuff

* Update src/ui/RoomSettings.cpp

Co-authored-by: DeepBlueV7.X <nicolas.werner@hotmail.de>

* Update src/ui/RoomSettings.cpp

Co-authored-by: DeepBlueV7.X <nicolas.werner@hotmail.de>

* Fix linting

Co-authored-by: DeepBlueV7.X <nicolas.werner@hotmail.de>
Diffstat (limited to 'src/encryption/DeviceVerificationFlow.cpp')
-rw-r--r--src/encryption/DeviceVerificationFlow.cpp38
1 files changed, 20 insertions, 18 deletions
diff --git a/src/encryption/DeviceVerificationFlow.cpp b/src/encryption/DeviceVerificationFlow.cpp

index b0e8a73b..df5e0c3e 100644 --- a/src/encryption/DeviceVerificationFlow.cpp +++ b/src/encryption/DeviceVerificationFlow.cpp
@@ -31,8 +31,8 @@ key_verification_mac(mtx::crypto::SAS *sas, DeviceVerificationFlow::DeviceVerificationFlow(QObject *, DeviceVerificationFlow::Type flow_type, TimelineModel *model, - QString userID, - std::vector<QString> deviceIds_) + const QString &userID, + const std::vector<QString> &deviceIds_) : sender(false) , type(flow_type) , deviceIds(std::move(deviceIds_)) @@ -86,12 +86,14 @@ DeviceVerificationFlow::DeviceVerificationFlow(QObject *, }); if (model) { - connect( - this->model_, &TimelineModel::updateFlowEventId, this, [this](std::string event_id_) { - this->relation.rel_type = mtx::common::RelationType::Reference; - this->relation.event_id = event_id_; - this->transaction_id = event_id_; - }); + connect(this->model_, + &TimelineModel::updateFlowEventId, + this, + [this](const std::string &event_id_) { + this->relation.rel_type = mtx::common::RelationType::Reference; + this->relation.event_id = event_id_; + this->transaction_id = event_id_; + }); } connect(timeout, &QTimer::timeout, this, [this]() { @@ -548,7 +550,7 @@ DeviceVerificationFlow::isSelfVerification() const } void -DeviceVerificationFlow::setEventId(std::string event_id_) +DeviceVerificationFlow::setEventId(const std::string &event_id_) { this->relation.rel_type = mtx::common::RelationType::Reference; this->relation.event_id = event_id_; @@ -864,8 +866,8 @@ QSharedPointer<DeviceVerificationFlow> DeviceVerificationFlow::NewInRoomVerification(QObject *parent_, TimelineModel *timelineModel_, const mtx::events::msg::KeyVerificationRequest &msg, - QString other_user_, - QString event_id_) + const QString &other_user_, + const QString &event_id_) { QSharedPointer<DeviceVerificationFlow> flow( new DeviceVerificationFlow(parent_, @@ -887,8 +889,8 @@ DeviceVerificationFlow::NewInRoomVerification(QObject *parent_, QSharedPointer<DeviceVerificationFlow> DeviceVerificationFlow::NewToDeviceVerification(QObject *parent_, const mtx::events::msg::KeyVerificationRequest &msg, - QString other_user_, - QString txn_id_) + const QString &other_user_, + const QString &txn_id_) { QSharedPointer<DeviceVerificationFlow> flow(new DeviceVerificationFlow( parent_, Type::ToDevice, nullptr, other_user_, {QString::fromStdString(msg.from_device)})); @@ -905,8 +907,8 @@ DeviceVerificationFlow::NewToDeviceVerification(QObject *parent_, QSharedPointer<DeviceVerificationFlow> DeviceVerificationFlow::NewToDeviceVerification(QObject *parent_, const mtx::events::msg::KeyVerificationStart &msg, - QString other_user_, - QString txn_id_) + const QString &other_user_, + const QString &txn_id_) { QSharedPointer<DeviceVerificationFlow> flow(new DeviceVerificationFlow( parent_, Type::ToDevice, nullptr, other_user_, {QString::fromStdString(msg.from_device)})); @@ -919,7 +921,7 @@ DeviceVerificationFlow::NewToDeviceVerification(QObject *parent_, QSharedPointer<DeviceVerificationFlow> DeviceVerificationFlow::InitiateUserVerification(QObject *parent_, TimelineModel *timelineModel_, - QString userid) + const QString &userid) { QSharedPointer<DeviceVerificationFlow> flow( new DeviceVerificationFlow(parent_, Type::RoomMsg, timelineModel_, userid, {})); @@ -928,8 +930,8 @@ DeviceVerificationFlow::InitiateUserVerification(QObject *parent_, } QSharedPointer<DeviceVerificationFlow> DeviceVerificationFlow::InitiateDeviceVerification(QObject *parent_, - QString userid, - std::vector<QString> devices) + const QString &userid, + const std::vector<QString> &devices) { assert(!devices.empty());