diff --git a/src/crypto/verification/request/InRoomChannel.js b/src/crypto/verification/request/InRoomChannel.js index ed0613a82..15d522509 100644 --- a/src/crypto/verification/request/InRoomChannel.js +++ b/src/crypto/verification/request/InRoomChannel.js @@ -128,11 +128,13 @@ export class InRoomChannel { static validateEvent(event, client) { const txnId = InRoomChannel.getTransactionId(event); if (typeof txnId !== "string" || txnId.length === 0) { - logger.log("InRoomChannel: validateEvent: no valid txnId " + txnId); return false; } const type = InRoomChannel.getEventType(event); const content = event.getContent(); + + // from here on we're fairly sure that this is supposed to be + // part of a verification request, so be noisy when rejecting something if (type === REQUEST_TYPE) { if (!content || typeof content.to !== "string" || !content.to.length) { logger.log("InRoomChannel: validateEvent: " + diff --git a/src/crypto/verification/request/VerificationRequest.js b/src/crypto/verification/request/VerificationRequest.js index 452bfebca..4c5fcd648 100644 --- a/src/crypto/verification/request/VerificationRequest.js +++ b/src/crypto/verification/request/VerificationRequest.js @@ -84,13 +84,15 @@ export class VerificationRequest extends EventEmitter { static validateEvent(type, event, client) { const content = event.getContent(); - if (!content) { - logger.log("VerificationRequest: validateEvent: no content"); - } if (!type.startsWith(EVENT_PREFIX)) { - logger.log("VerificationRequest: validateEvent: " + - "fail because type doesnt start with " + EVENT_PREFIX); + return false; + } + + // from here on we're fairly sure that this is supposed to be + // part of a verification request, so be noisy when rejecting something + if (!content) { + logger.log("VerificationRequest: validateEvent: no content"); return false; }