From 3c571770ed3ee26893453b93b702cda833d1a824 Mon Sep 17 00:00:00 2001 From: Vincent Date: Tue, 28 Apr 2020 11:43:34 +1000 Subject: [PATCH] Useful comments --- js/models/conversations.js | 18 ++++++++++++++++++ js/modules/loki_message_api.js | 2 ++ js/modules/signal.js | 2 ++ js/views/conversation_view.js | 13 +++++++++++++ libtextsecure/sendmessage.js | 2 ++ 5 files changed, 37 insertions(+) diff --git a/js/models/conversations.js b/js/models/conversations.js index 48c6781df..aec9987f9 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -649,6 +649,8 @@ ); }, async updateVerified() { + console.log('[vince] conversations.js --> updateVerified()'); + if (this.isPrivate()) { await this.initialPromise; const verified = await this.safeGetVerified(); @@ -850,9 +852,12 @@ return allDeviceStatus === FriendRequestStatusEnum.friends; }, getFriendRequestStatus() { + return this.get('friendRequestStatus'); }, async getPrimaryConversation() { + console.log('[vince] conversation.js --> getPrimaryConversation'); + if (!this.isSecondaryDevice()) { // This is already the primary conversation return this; @@ -870,6 +875,8 @@ return this; }, async updateTextInputState() { + console.log('[vince] conversation.js --> updateTextInputState'); + if (this.isRss()) { // or if we're an rss conversation, disable it this.trigger('disable:input', true); @@ -919,6 +926,8 @@ return this.get('primaryDevicePubKey') || this.id; }, async setSecondaryStatus(newStatus, primaryDevicePubKey) { + console.log('[vince] conversation.js --> setSecondaryStatus'); + if (this.get('secondaryStatus') !== newStatus) { this.set({ secondaryStatus: newStatus, @@ -930,6 +939,8 @@ } }, async setFriendRequestStatus(newStatus, options = {}) { + console.log('[vince] conversation.js --> setFriendRequestStatus'); + const { blockSync } = options; // Ensure that the new status is a valid FriendStatusEnum value if (!(newStatus in Object.values(FriendRequestStatusEnum))) { @@ -1536,6 +1547,13 @@ ) { this.clearTypingTimers(); + console.log(`[vince] conversations.js --> body:`, body); + console.log(`[vince] conversations.js --> attachments:`, attachments); + console.log(`[vince] conversations.js --> quote:`, quote); + console.log(`[vince] conversations.js --> preview:`, preview); + console.log(`[vince] conversations.js --> groupInvitation:`, groupInvitation); + console.log(`[vince] conversations.js --> otherOptions:`, otherOptions); + const destination = this.id; const expireTimer = this.get('expireTimer'); const recipients = this.getRecipients(); diff --git a/js/modules/loki_message_api.js b/js/modules/loki_message_api.js index 8c7de6553..dbd675e27 100644 --- a/js/modules/loki_message_api.js +++ b/js/modules/loki_message_api.js @@ -40,6 +40,8 @@ class LokiMessageAPI { } async sendMessage(pubKey, data, messageTimeStamp, ttl, options = {}) { + console.log('[vince] outgoing_message.js --> loki_message_api.js --> sendMessage'); + const { isPublic = false, numConnections = DEFAULT_CONNECTIONS, diff --git a/js/modules/signal.js b/js/modules/signal.js index c676c5845..eb719836e 100644 --- a/js/modules/signal.js +++ b/js/modules/signal.js @@ -235,6 +235,8 @@ function initializeMigrations({ logger, }), upgradeMessageSchema: (message, options = {}) => { + console.log('[vince] signal.js --> upgradeMessageSchema'); + const { maxVersion } = options; return MessageType.upgradeSchema(message, { diff --git a/js/views/conversation_view.js b/js/views/conversation_view.js index 858cfccee..f7b958dba 100644 --- a/js/views/conversation_view.js +++ b/js/views/conversation_view.js @@ -1629,6 +1629,8 @@ }, showSendConfirmationDialog(e, contacts) { + console.log('[vince] conversation_view.js --> showSendConfirmationDialog'); + let message; const isUnverified = this.model.isUnverified(); @@ -1704,6 +1706,8 @@ }, async handleSubmitPressed(e, options = {}) { + console.log(`[vince] handleSubmitPressed e:`, e); + if (this.memberView.membersShown()) { const member = this.memberView.selectedMember(); this.selectMember(member); @@ -1713,6 +1717,8 @@ }, async checkUnverifiedSendMessage(e, options = {}) { + console.log(`[vince] checkUnverifiedSendMessage e:`, e); + e.preventDefault(); this.sendStart = Date.now(); this.$messageField.attr('disabled', true); @@ -1746,6 +1752,8 @@ }, async checkUntrustedSendMessage(e, options = {}) { + console.log(`[vince] checkUntrustedSendMessage e:`, e); + _.defaults(options, { force: false }); try { @@ -1907,6 +1915,8 @@ let message = this.memberView.replaceMentions(input.val()); message = window.Signal.Emoji.replaceColons(message).trim(); + + const toastOptions = { type: 'info' }; // let it pass if we're still trying to read it or it's false... if (extension.expiredStatus() === true) { @@ -2470,6 +2480,9 @@ !event.shiftKey && !event.ctrlKey ) { + + console.log('[vince] conversation_view.hs --> handleInputEvent:', Date.now()); + // enter pressed - submit the form now event.preventDefault(); this.$('.bottom-bar form').submit(); diff --git a/libtextsecure/sendmessage.js b/libtextsecure/sendmessage.js index a0bfe4267..d656f7304 100644 --- a/libtextsecure/sendmessage.js +++ b/libtextsecure/sendmessage.js @@ -514,6 +514,8 @@ MessageSender.prototype = { }, createSyncMessage() { + console.log('[vince] sendmessage.js --> createSyncMessage'); + const syncMessage = new textsecure.protobuf.SyncMessage(); // Generate a random int from 1 and 512