Skip to content

Commit

Permalink
More logging
Browse files Browse the repository at this point in the history
// FREEBIE
  • Loading branch information
liliakai committed Dec 18, 2015
1 parent 51fc10a commit d95f869
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
ConversationController.updateInbox();

extension.onLaunched(function() {
console.log('extension launched');
storage.onready(function() {
if (textsecure.registration.isDone()) {
openInbox();
Expand Down Expand Up @@ -112,6 +113,7 @@
}

function onContactSyncComplete() {
console.log('Contact sync complete');
window.dispatchEvent(new Event('textsecure:contactsync'));
}

Expand Down Expand Up @@ -227,7 +229,7 @@
var timestamp = pushMessage.timestamp.toNumber();
var messages = new Whisper.MessageCollection();
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()) {
// disregard delivery receipts from myself
Expand Down
6 changes: 4 additions & 2 deletions js/libtextsecure.js
Original file line number Diff line number Diff line change
Expand Up @@ -36802,8 +36802,6 @@ MessageReceiver.prototype = {
// user they received an invalid message
request.respond(200, 'OK');

console.log('envelope', envelope.source + '.' + envelope.sourceDevice, envelope.timestamp);

if (envelope.type === textsecure.protobuf.Envelope.Type.RECEIPT) {
return this.onDeliveryReceipt(envelope);
} else if (envelope.content) {
Expand Down Expand Up @@ -36867,6 +36865,7 @@ MessageReceiver.prototype = {
}.bind(this));
},
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) ==
textsecure.protobuf.DataMessage.Flags.END_SESSION ) {
close_session();
Expand Down Expand Up @@ -36912,6 +36911,7 @@ MessageReceiver.prototype = {
}
if (syncMessage.sent) {
var sentMessage = syncMessage.sent;
console.log('sent message to', sentMessage.destination, envelope.timestamp.toNumber(), 'from', envelope.source + '.' + envelope.sourceDevice);
return this.handleSentMessage(
sentMessage.destination,
sentMessage.timestamp,
Expand All @@ -36928,6 +36928,7 @@ MessageReceiver.prototype = {
}
},
handleContacts: function(contacts) {
console.log('contact sync');
var eventTarget = this;
var attachmentPointer = contacts.blob;
return this.handleAttachment(attachmentPointer).then(function() {
Expand All @@ -36943,6 +36944,7 @@ MessageReceiver.prototype = {
});
},
handleGroups: function(groups) {
console.log('group sync');
var eventTarget = this;
var attachmentPointer = groups.blob;
return this.handleAttachment(attachmentPointer).then(function() {
Expand Down
6 changes: 4 additions & 2 deletions libtextsecure/message_receiver.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ MessageReceiver.prototype = {
// user they received an invalid message
request.respond(200, 'OK');

console.log('envelope', envelope.source + '.' + envelope.sourceDevice, envelope.timestamp);

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

0 comments on commit d95f869

Please sign in to comment.