Skip to content

Commit

Permalink
Merge #690(tobias): Add some logging to key verification event handling
Browse files Browse the repository at this point in the history
  • Loading branch information
KitsuneRal authored Aug 6, 2023
2 parents d850d15 + b629129 commit 074fcb8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
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

0 comments on commit 074fcb8

Please sign in to comment.