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

Add some logging to key verification event handling #690

Merged
merged 1 commit into from
Aug 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion Quotient/connectionencryptiondata_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,14 @@ bool ConnectionEncryptionData::processIfVerificationEvent(const Event& evt,
reqEvt, q, encrypted);
return true;
},
[](const KeyVerificationDoneEvent&) { return true; },
[](const KeyVerificationDoneEvent&) {
qCDebug(E2EE) << "Ignoring m.key.verification.done";
return true;
},
[this](const KeyVerificationEvent& kvEvt) {
if (auto* const session =
verificationSessions.value(kvEvt.transactionId())) {
qCDebug(E2EE) << "Handling" << kvEvt.matrixType();
session->handleEvent(kvEvt);
emit q->keyVerificationStateChanged(session, session->state());
}
Expand Down
3 changes: 3 additions & 0 deletions Quotient/connectionencryptiondata_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include "e2ee/qolmaccount.h"
#include "e2ee/qolmsession.h"

#include "logging_categories_p.h"

namespace Quotient {

struct DevicesList;
Expand Down Expand Up @@ -80,6 +82,7 @@ namespace _impl {
{
auto session =
new KeyVerificationSession(std::forward<ArgTs>(sessionArgs)...);
qCDebug(E2EE) << "Incoming key verification session from" << session->remoteDeviceId();
verificationSessions.insert(session->transactionId(), session);
QObject::connect(session, &QObject::destroyed, q,
[this, txnId = session->transactionId()] {
Expand Down
1 change: 1 addition & 0 deletions Quotient/keyverificationsession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ KeyVerificationSession::State KeyVerificationSession::state() const

void KeyVerificationSession::setState(KeyVerificationSession::State state)
{
qCDebug(E2EE) << "KeyVerificationSession state" << m_state << "->" << state;
m_state = state;
emit stateChanged();
}
Expand Down