More logging

// FREEBIE
This commit is contained in:
lilia 2015-12-16 15:24:07 -08:00
parent 51fc10abb6
commit d95f869d62
3 changed files with 11 additions and 5 deletions

View file

@ -38,6 +38,7 @@
ConversationController.updateInbox(); ConversationController.updateInbox();
extension.onLaunched(function() { extension.onLaunched(function() {
console.log('extension launched');
storage.onready(function() { storage.onready(function() {
if (textsecure.registration.isDone()) { if (textsecure.registration.isDone()) {
openInbox(); openInbox();
@ -112,6 +113,7 @@
} }
function onContactSyncComplete() { function onContactSyncComplete() {
console.log('Contact sync complete');
window.dispatchEvent(new Event('textsecure:contactsync')); window.dispatchEvent(new Event('textsecure:contactsync'));
} }
@ -227,7 +229,7 @@
var timestamp = pushMessage.timestamp.toNumber(); var timestamp = pushMessage.timestamp.toNumber();
var messages = new Whisper.MessageCollection(); var messages = new Whisper.MessageCollection();
var groups = new Whisper.ConversationCollection(); var groups = new Whisper.ConversationCollection();
console.log('delivery receipt', pushMessage.source, timestamp); console.log('delivery receipt from', pushMessage.source + '.' + pushMessage.sourceDevice, timestamp);
if (pushMessage.source === textsecure.storage.user.getNumber()) { if (pushMessage.source === textsecure.storage.user.getNumber()) {
// disregard delivery receipts from myself // disregard delivery receipts from myself

View file

@ -36802,8 +36802,6 @@ 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) {
@ -36867,6 +36865,7 @@ MessageReceiver.prototype = {
}.bind(this)); }.bind(this));
}, },
handleDataMessage: function(envelope, message, close_session) { handleDataMessage: function(envelope, message, close_session) {
console.log('data message from', envelope.source + '.' + envelope.sourceDevice, envelope.timestamp.toNumber());
if ((message.flags & textsecure.protobuf.DataMessage.Flags.END_SESSION) == if ((message.flags & textsecure.protobuf.DataMessage.Flags.END_SESSION) ==
textsecure.protobuf.DataMessage.Flags.END_SESSION ) { textsecure.protobuf.DataMessage.Flags.END_SESSION ) {
close_session(); close_session();
@ -36912,6 +36911,7 @@ MessageReceiver.prototype = {
} }
if (syncMessage.sent) { if (syncMessage.sent) {
var sentMessage = syncMessage.sent; var sentMessage = syncMessage.sent;
console.log('sent message to', sentMessage.destination, envelope.timestamp.toNumber(), 'from', envelope.source + '.' + envelope.sourceDevice);
return this.handleSentMessage( return this.handleSentMessage(
sentMessage.destination, sentMessage.destination,
sentMessage.timestamp, sentMessage.timestamp,
@ -36928,6 +36928,7 @@ MessageReceiver.prototype = {
} }
}, },
handleContacts: function(contacts) { handleContacts: function(contacts) {
console.log('contact sync');
var eventTarget = this; var eventTarget = this;
var attachmentPointer = contacts.blob; var attachmentPointer = contacts.blob;
return this.handleAttachment(attachmentPointer).then(function() { return this.handleAttachment(attachmentPointer).then(function() {
@ -36943,6 +36944,7 @@ MessageReceiver.prototype = {
}); });
}, },
handleGroups: function(groups) { handleGroups: function(groups) {
console.log('group sync');
var eventTarget = this; var eventTarget = this;
var attachmentPointer = groups.blob; var attachmentPointer = groups.blob;
return this.handleAttachment(attachmentPointer).then(function() { return this.handleAttachment(attachmentPointer).then(function() {

View file

@ -70,8 +70,6 @@ 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) {
@ -135,6 +133,7 @@ MessageReceiver.prototype = {
}.bind(this)); }.bind(this));
}, },
handleDataMessage: function(envelope, message, close_session) { handleDataMessage: function(envelope, message, close_session) {
console.log('data message from', envelope.source + '.' + envelope.sourceDevice, envelope.timestamp.toNumber());
if ((message.flags & textsecure.protobuf.DataMessage.Flags.END_SESSION) == if ((message.flags & textsecure.protobuf.DataMessage.Flags.END_SESSION) ==
textsecure.protobuf.DataMessage.Flags.END_SESSION ) { textsecure.protobuf.DataMessage.Flags.END_SESSION ) {
close_session(); close_session();
@ -180,6 +179,7 @@ MessageReceiver.prototype = {
} }
if (syncMessage.sent) { if (syncMessage.sent) {
var sentMessage = syncMessage.sent; var sentMessage = syncMessage.sent;
console.log('sent message to', sentMessage.destination, envelope.timestamp.toNumber(), 'from', envelope.source + '.' + envelope.sourceDevice);
return this.handleSentMessage( return this.handleSentMessage(
sentMessage.destination, sentMessage.destination,
sentMessage.timestamp, sentMessage.timestamp,
@ -196,6 +196,7 @@ MessageReceiver.prototype = {
} }
}, },
handleContacts: function(contacts) { handleContacts: function(contacts) {
console.log('contact sync');
var eventTarget = this; var eventTarget = this;
var attachmentPointer = contacts.blob; var attachmentPointer = contacts.blob;
return this.handleAttachment(attachmentPointer).then(function() { return this.handleAttachment(attachmentPointer).then(function() {
@ -211,6 +212,7 @@ MessageReceiver.prototype = {
}); });
}, },
handleGroups: function(groups) { handleGroups: function(groups) {
console.log('group sync');
var eventTarget = this; var eventTarget = this;
var attachmentPointer = groups.blob; var attachmentPointer = groups.blob;
return this.handleAttachment(attachmentPointer).then(function() { return this.handleAttachment(attachmentPointer).then(function() {