More verbose logging in message receiver
// FREEBIE
This commit is contained in:
parent
7215afb6c7
commit
d201c65f7c
2 changed files with 12 additions and 4 deletions
|
@ -36802,6 +36802,8 @@ MessageReceiver.prototype = {
|
||||||
// user they received an invalid message
|
// user they received an invalid message
|
||||||
request.respond(200, 'OK');
|
request.respond(200, 'OK');
|
||||||
|
|
||||||
|
console.log('envelope', envelope.source + '.' + envelope.sourceDevice, envelope.timestamp);
|
||||||
|
|
||||||
if (envelope.type === textsecure.protobuf.Envelope.Type.RECEIPT) {
|
if (envelope.type === textsecure.protobuf.Envelope.Type.RECEIPT) {
|
||||||
return this.onDeliveryReceipt(envelope);
|
return this.onDeliveryReceipt(envelope);
|
||||||
} else if (envelope.content) {
|
} else if (envelope.content) {
|
||||||
|
@ -36809,7 +36811,7 @@ MessageReceiver.prototype = {
|
||||||
} else if (envelope.legacyMessage) {
|
} else if (envelope.legacyMessage) {
|
||||||
return this.handleLegacyMessage(envelope);
|
return this.handleLegacyMessage(envelope);
|
||||||
} else {
|
} else {
|
||||||
throw new Error('Received message with no content and no legacyMessage');
|
throw new Error('Received envelope with no content and no legacyMessage');
|
||||||
}
|
}
|
||||||
|
|
||||||
}.bind(this)).catch(function(e) {
|
}.bind(this)).catch(function(e) {
|
||||||
|
@ -36919,8 +36921,10 @@ MessageReceiver.prototype = {
|
||||||
this.handleContacts(syncMessage.contacts);
|
this.handleContacts(syncMessage.contacts);
|
||||||
} else if (syncMessage.groups) {
|
} else if (syncMessage.groups) {
|
||||||
this.handleGroups(syncMessage.groups);
|
this.handleGroups(syncMessage.groups);
|
||||||
|
} else if (syncMessage.request) {
|
||||||
|
console.log('Got SyncMessage Request');
|
||||||
} else {
|
} else {
|
||||||
throw new Error('Got SyncMessage with no sent, contacts, or groups');
|
throw new Error('Got empty SyncMessage');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleContacts: function(contacts) {
|
handleContacts: function(contacts) {
|
||||||
|
|
|
@ -70,6 +70,8 @@ MessageReceiver.prototype = {
|
||||||
// user they received an invalid message
|
// user they received an invalid message
|
||||||
request.respond(200, 'OK');
|
request.respond(200, 'OK');
|
||||||
|
|
||||||
|
console.log('envelope', envelope.source + '.' + envelope.sourceDevice, envelope.timestamp);
|
||||||
|
|
||||||
if (envelope.type === textsecure.protobuf.Envelope.Type.RECEIPT) {
|
if (envelope.type === textsecure.protobuf.Envelope.Type.RECEIPT) {
|
||||||
return this.onDeliveryReceipt(envelope);
|
return this.onDeliveryReceipt(envelope);
|
||||||
} else if (envelope.content) {
|
} else if (envelope.content) {
|
||||||
|
@ -77,7 +79,7 @@ MessageReceiver.prototype = {
|
||||||
} else if (envelope.legacyMessage) {
|
} else if (envelope.legacyMessage) {
|
||||||
return this.handleLegacyMessage(envelope);
|
return this.handleLegacyMessage(envelope);
|
||||||
} else {
|
} else {
|
||||||
throw new Error('Received message with no content and no legacyMessage');
|
throw new Error('Received envelope with no content and no legacyMessage');
|
||||||
}
|
}
|
||||||
|
|
||||||
}.bind(this)).catch(function(e) {
|
}.bind(this)).catch(function(e) {
|
||||||
|
@ -187,8 +189,10 @@ MessageReceiver.prototype = {
|
||||||
this.handleContacts(syncMessage.contacts);
|
this.handleContacts(syncMessage.contacts);
|
||||||
} else if (syncMessage.groups) {
|
} else if (syncMessage.groups) {
|
||||||
this.handleGroups(syncMessage.groups);
|
this.handleGroups(syncMessage.groups);
|
||||||
|
} else if (syncMessage.request) {
|
||||||
|
console.log('Got SyncMessage Request');
|
||||||
} else {
|
} else {
|
||||||
throw new Error('Got SyncMessage with no sent, contacts, or groups');
|
throw new Error('Got empty SyncMessage');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleContacts: function(contacts) {
|
handleContacts: function(contacts) {
|
||||||
|
|
Loading…
Reference in a new issue