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>
This commit is contained in:
parent
5e9eb845ab
commit
8ecbb39dc6
33 changed files with 162 additions and 146 deletions
|
|
@ -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());
|
||||
|
||||
|
|
|
|||
|
|
@ -110,22 +110,26 @@ public:
|
|||
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_);
|
||||
static QSharedPointer<DeviceVerificationFlow>
|
||||
NewToDeviceVerification(QObject *parent_,
|
||||
const mtx::events::msg::KeyVerificationRequest &msg,
|
||||
QString other_user_,
|
||||
QString txn_id_);
|
||||
const QString &other_user_,
|
||||
const QString &txn_id_);
|
||||
static QSharedPointer<DeviceVerificationFlow>
|
||||
NewToDeviceVerification(QObject *parent_,
|
||||
const mtx::events::msg::KeyVerificationStart &msg,
|
||||
QString other_user_,
|
||||
QString txn_id_);
|
||||
const QString &other_user_,
|
||||
const QString &txn_id_);
|
||||
static QSharedPointer<DeviceVerificationFlow>
|
||||
InitiateUserVerification(QObject *parent_, TimelineModel *timelineModel_, QString userid);
|
||||
InitiateUserVerification(QObject *parent_,
|
||||
TimelineModel *timelineModel_,
|
||||
const QString &userid);
|
||||
static QSharedPointer<DeviceVerificationFlow>
|
||||
InitiateDeviceVerification(QObject *parent, QString userid, std::vector<QString> devices);
|
||||
InitiateDeviceVerification(QObject *parent,
|
||||
const QString &userid,
|
||||
const std::vector<QString> &devices);
|
||||
|
||||
// getters
|
||||
QString state();
|
||||
|
|
@ -137,7 +141,7 @@ public:
|
|||
QString transactionId() { return QString::fromStdString(this->transaction_id); }
|
||||
// setters
|
||||
void setDeviceId(QString deviceID);
|
||||
void setEventId(std::string event_id);
|
||||
void setEventId(const std::string &event_id);
|
||||
bool isDeviceVerification() const
|
||||
{
|
||||
return this->type == DeviceVerificationFlow::Type::ToDevice;
|
||||
|
|
@ -164,8 +168,8 @@ private:
|
|||
DeviceVerificationFlow(QObject *,
|
||||
DeviceVerificationFlow::Type flow_type,
|
||||
TimelineModel *model,
|
||||
QString userID,
|
||||
std::vector<QString> deviceIds_);
|
||||
const QString &userID,
|
||||
const std::vector<QString> &deviceIds_);
|
||||
void setState(State state)
|
||||
{
|
||||
if (state != state_) {
|
||||
|
|
|
|||
|
|
@ -951,7 +951,7 @@ download_full_keybackup()
|
|||
});
|
||||
}
|
||||
void
|
||||
lookup_keybackup(const std::string room, const std::string session_id)
|
||||
lookup_keybackup(const std::string &room, const std::string &session_id)
|
||||
{
|
||||
if (!UserSettings::instance()->useOnlineKeyBackup()) {
|
||||
// Online key backup disabled
|
||||
|
|
@ -1283,7 +1283,7 @@ calculate_trust(const std::string &user_id, const MegolmSessionIndex &index)
|
|||
//! Send encrypted to device messages, targets is a map from userid to device ids or {} for all
|
||||
//! devices
|
||||
void
|
||||
send_encrypted_to_device_messages(const std::map<std::string, std::vector<std::string>> targets,
|
||||
send_encrypted_to_device_messages(const std::map<std::string, std::vector<std::string>> &targets,
|
||||
const mtx::events::collections::DeviceEvents &event,
|
||||
bool force_new_session)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ void
|
|||
import_inbound_megolm_session(
|
||||
const mtx::events::DeviceEvent<mtx::events::msg::ForwardedRoomKey> &roomKey);
|
||||
void
|
||||
lookup_keybackup(const std::string room, const std::string session_id);
|
||||
lookup_keybackup(const std::string &room, const std::string &session_id);
|
||||
void
|
||||
download_full_keybackup();
|
||||
|
||||
|
|
@ -119,7 +119,7 @@ send_megolm_key_to_device(const std::string &user_id,
|
|||
//! Send encrypted to device messages, targets is a map from userid to device ids or {} for all
|
||||
//! devices
|
||||
void
|
||||
send_encrypted_to_device_messages(const std::map<std::string, std::vector<std::string>> targets,
|
||||
send_encrypted_to_device_messages(const std::map<std::string, std::vector<std::string>> &targets,
|
||||
const mtx::events::collections::DeviceEvents &event,
|
||||
bool force_new_session = false);
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,9 @@ SelfVerificationStatus::SelfVerificationStatus(QObject *o)
|
|||
}
|
||||
|
||||
void
|
||||
SelfVerificationStatus::setupCrosssigning(bool useSSSS, QString password, bool useOnlineKeyBackup)
|
||||
SelfVerificationStatus::setupCrosssigning(bool useSSSS,
|
||||
const QString &password,
|
||||
bool useOnlineKeyBackup)
|
||||
{
|
||||
nhlog::db()->info("Clicked setup crossigning");
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,8 @@ public:
|
|||
};
|
||||
Q_ENUM(Status)
|
||||
|
||||
Q_INVOKABLE void setupCrosssigning(bool useSSSS, QString password, bool useOnlineKeyBackup);
|
||||
Q_INVOKABLE void
|
||||
setupCrosssigning(bool useSSSS, const QString &password, bool useOnlineKeyBackup);
|
||||
Q_INVOKABLE void verifyMasterKey();
|
||||
Q_INVOKABLE void verifyMasterKeyWithPassphrase();
|
||||
Q_INVOKABLE void verifyUnverifiedDevices();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue