From c39d6687e5a56b1fc818efaeb78edde962712554 Mon Sep 17 00:00:00 2001 From: lilia Date: Mon, 18 Jul 2016 15:48:09 -0700 Subject: [PATCH] Reduce log noise from delivery receipts Stop logging envelope messages on receipts since we log the same info as a receipt in background.js. // FREEBIE --- js/libtextsecure.js | 6 ++++-- libtextsecure/message_receiver.js | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/js/libtextsecure.js b/js/libtextsecure.js index 5f10d460..5df14b16 100644 --- a/js/libtextsecure.js +++ b/js/libtextsecure.js @@ -37997,10 +37997,12 @@ MessageReceiver.prototype.extend({ this.pending = this.pending.then(handleEnvelope, handleEnvelope); }, handleEnvelope: function(envelope) { - console.log('envelope from', envelope.source + '.' + envelope.sourceDevice, envelope.timestamp.toNumber()); if (envelope.type === textsecure.protobuf.Envelope.Type.RECEIPT) { return this.onDeliveryReceipt(envelope); - } else if (envelope.content) { + } + + console.log('envelope from', envelope.source + '.' + envelope.sourceDevice, envelope.timestamp.toNumber()); + if (envelope.content) { return this.handleContentMessage(envelope); } else if (envelope.legacyMessage) { return this.handleLegacyMessage(envelope); diff --git a/libtextsecure/message_receiver.js b/libtextsecure/message_receiver.js index 50bdd3cd..2f2b1e21 100644 --- a/libtextsecure/message_receiver.js +++ b/libtextsecure/message_receiver.js @@ -85,10 +85,12 @@ MessageReceiver.prototype.extend({ this.pending = this.pending.then(handleEnvelope, handleEnvelope); }, handleEnvelope: function(envelope) { - console.log('envelope from', envelope.source + '.' + envelope.sourceDevice, envelope.timestamp.toNumber()); if (envelope.type === textsecure.protobuf.Envelope.Type.RECEIPT) { return this.onDeliveryReceipt(envelope); - } else if (envelope.content) { + } + + console.log('envelope from', envelope.source + '.' + envelope.sourceDevice, envelope.timestamp.toNumber()); + if (envelope.content) { return this.handleContentMessage(envelope); } else if (envelope.legacyMessage) { return this.handleLegacyMessage(envelope);